package main
import (
"fmt"
"net/http"
"time"
socketio "github.com/leviathan-1776/socketio-client-go"
)
func main() {
var header http.Header = map[string][]string{}
s, err := socketio.Socket("ws://127.0.0.1:3000")
if err != nil {
panic(err)
}
s.Connect(header)
s.On("message", func(args ...interface{}) {
fmt.Println(args[0])
})
for {
s.Emit("message", "hello server!")
time.Sleep(2 * time.Second)
}
}
forked from leviathan-1776/socketio-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
License
nicklaus-dev/socketio-client-go
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Go 100.0%