add flags to client
This commit is contained in:
parent
7d1a358438
commit
6f91491127
@ -2,10 +2,12 @@ package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
@ -63,8 +65,12 @@ func main() {
|
||||
output := make(chan string)
|
||||
|
||||
signal.Notify(interrupt, os.Interrupt) // Notify the interrupt channel for SIGINT
|
||||
hostname := flag.String("host", "localhost", "server hostname to connect to")
|
||||
port := flag.Int("port", 7636, "port to connect to")
|
||||
|
||||
socketUrl := "ws://localhost:7636" + "/ws"
|
||||
flag.Parse()
|
||||
port_s := strconv.Itoa(*port)
|
||||
socketUrl := "ws://" + *hostname + ":" + port_s + "/ws"
|
||||
conn, _, err := websocket.DefaultDialer.Dial(socketUrl, nil)
|
||||
id := uuid.New()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user