Skip to content

nicklaus-dev/socketio-client-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golang socket.io client

example

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)
	}
}

server

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%