WebSocket

Using net WebSocket

Server

cookbook/websocket/net/server.go

  1. loading...

Using gorilla WebSocket

Server

cookbook/websocket/gorilla/server.go

  1. loading...

Client

cookbook/websocket/public/index.html

  1. loading...

Output

  1. Hello, Client!
  2. Hello, Client!
  3. Hello, Client!
  4. Hello, Client!
  5. Hello, Client!
  1. Hello, Server!
  2. Hello, Server!
  3. Hello, Server!
  4. Hello, Server!
  5. Hello, Server!