Пример #1
0
func ExampleServer_Handle() {
	s := gs.NewServer()
	s.Handle("/hello", printHandler)
	s.Handle("/hello", responseHandler)

	http.Handle("/gs/", s)
	http.HandleFunc("/", index)
	http.ListenAndServe(":6060", nil)
}
Пример #2
0
func ExampleServer() {
	s := gs.NewServer()

	s.On(gs.Connect, func(c *gs.Conn) {
		c.Send("hello", "world")
	})

	http.ListenAndServe(":6060", s)
}