code: func newWebsocketClient(server *rpcServer, conn *websocket.Conn,
  	remoteAddr string, authenticated bool, isAdmin bool) (*wsClient, error) {
  
  	sessionID, err := wire.RandomUint64()
  	if err != nil {
  		return nil, err
  	}
  
  	client := &wsClient{
  		conn:              conn,
  		addr:              remoteAddr,
  		authenticated:     authenticated,
  		isAdmin:           isAdmin,
  		sessionID:         sessionID,
  		server:            server,
  		addrRequests:      make(map[string]struct{}),
  		spentRequests:     make(map[wire.OutPoint]struct{}),
  		serviceRequestSem: makeSemaphore(cfg.RPCMaxConcurrentReqs),
  		ntfnChan:          make(chan []byte, 1), // nonblocking sync
  		sendChan:          make(chan wsResponse, websocketSendBufferSize),
  		quit:              make(chan struct{}),
  	}
  	return client, nil
  }
docs: // newWebsocketClient returns a new websocket client given the notification
  // manager, websocket connection, remote address, and whether or not the client
  // has already been authenticated (via HTTP Basic access authentication).  The
  // returned client is ready to start.  Once started, the client will process
  // incoming and outgoing messages in separate goroutines complete with queuing
  // and asynchrous handling for long-running operations.