code: func newSocket(ws *websocket.Conn) *Socket {
  	w := &Socket{
  		ws:        ws,
  		writeChan: make(chan string, global.WriteChanSize),
  		readChan:  make(chan string, global.ReadChanSize),
  	}
  
  	// Set the closer function.
  	w.closer = closer.New(func() {
  		// Send a close message to the client.
  		// Ignore errors.
  		w.write(websocket.CloseMessage, []byte{})
  
  		// Close the socket.
  		w.ws.Close()
  	})
  
  	return w
  }
docs: // Create a new websocket value.