feat: safe websocket client implementation

This commit is contained in:
2025-09-25 14:14:24 +07:00
parent eac2ed2bf1
commit ef98404caf
5 changed files with 255 additions and 68 deletions

View File

@@ -0,0 +1,25 @@
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))
}
}