26 lines
415 B
Go
26 lines
415 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
"git.neurocipta.com/rogerferdinan/safe-web-socket/v1/client"
|
|
)
|
|
|
|
func main() {
|
|
wsClient, err := client.NewSafeWebsocketClientBuilder().
|
|
BaseHost("localhost").
|
|
BasePort(8080).
|
|
Path("/ws/test/data_1").
|
|
UseTLS(false).
|
|
Build()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
dataChannel := wsClient.DataChannel()
|
|
|
|
for data := range dataChannel {
|
|
fmt.Println(string(data))
|
|
}
|
|
}
|