You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/events.go
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,8 @@ var (
45
45
clientIdstring
46
46
versionstring
47
47
websocketClientstring
48
+
websocketServerIPstring
49
+
websocketServerPortint
48
50
)
49
51
50
52
// websocketCmd-specific flags
@@ -173,7 +175,8 @@ func init() {
173
175
174
176
// websocket flags
175
177
/// flags for start-server
176
-
websocketCmd.Flags().IntVarP(&port, "port", "p", 8080, "Defines the port that the mock EventSub websocket server will run on.")
178
+
websocketCmd.Flags().StringVar(&websocketServerIP, "ip", "127.0.0.1", "Defines the ip that the mock EventSub websocket server will bind to.")
179
+
websocketCmd.Flags().IntVarP(&websocketServerPort, "port", "p", 8080, "Defines the port that the mock EventSub websocket server will run on.")
177
180
websocketCmd.Flags().BoolVar(&wsDebug, "debug", false, "Set on/off for debug messages for the EventSub WebSocket server.")
178
181
websocketCmd.Flags().BoolVarP(&wsStrict, "require-subscription", "S", false, "Requires subscriptions for all events, and activates 10 second subscription requirement.")
Copy file name to clipboardExpand all lines: cmd/token.go
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,9 @@
3
3
package cmd
4
4
5
5
import (
6
+
"fmt"
7
+
"strconv"
8
+
6
9
"github.com/twitchdev/twitch-cli/internal/login"
7
10
8
11
"github.com/spf13/cobra"
@@ -13,6 +16,8 @@ var isUserToken bool
13
16
varuserScopesstring
14
17
varrevokeTokenstring
15
18
varoverrideClientIdstring
19
+
vartokenServerPortint
20
+
vartokenServerIPstring
16
21
17
22
// loginCmd represents the login command
18
23
varloginCmd=&cobra.Command{
@@ -28,13 +33,16 @@ func init() {
28
33
loginCmd.Flags().StringVarP(&userScopes, "scopes", "s", "", "Space seperated list of scopes to request with your user token.")
29
34
loginCmd.Flags().StringVarP(&revokeToken, "revoke", "r", "", "Instead of generating a new token, revoke the one passed to this parameter.")
30
35
loginCmd.Flags().StringVar(&overrideClientId, "client-id", "", "Override/manually set client ID for token actions. By default client ID from CLI config will be used.")
36
+
loginCmd.Flags().StringVar(&tokenServerIP, "ip", "localhost", "Manually set the IP address to be binded to for the User Token web server.")
37
+
loginCmd.Flags().IntVarP(&tokenServerPort, "port", "p", 3000, "Manually set the port to be used for the User Token web server.")
log.Printf(lightGreen("For further usage information, please see our official documentation:\nhttps://dev.twitch.tv/docs/cli/websocket-event-command/"))
108
110
fmt.Println()
109
111
110
-
log.Printf(lightBlue("Connect to the WebSocket server at: ")+"ws://127.0.0.1:%v/ws", port)
112
+
log.Printf(lightBlue("Connect to the WebSocket server at: ")+"ws://%v:%v/ws", ip, port)
log.Printf("Failed to find primary server [%v] when new client was accessing ws://127.0.0.1:%v/ws -- Aborting...", serverManager.primaryServer, serverManager.port)
141
+
log.Printf("Failed to find primary server [%v] when new client was accessing ws://%v:%v/ws -- Aborting...", serverManager.primaryServer, serverManager.ip, serverManager.port)
DetailedInfo: "Command \"subscription\" requires flags --status, --subscription, and --session"+
218
-
fmt.Sprintf("\nThe flag --subscription must be the ID of the subscription made at http://localhost:%v/eventsub/subscriptions", serverManager.port) +
218
+
fmt.Sprintf("\nThe flag --subscription must be the ID of the subscription made at http://%v:%v/eventsub/subscriptions", serverManager.ip, serverManager.port) +
219
219
"\nThe flag --status must be one of the non-webhook status options defined here:"+
0 commit comments