code: func (s *Service) login(conn *websocket.Conn) error {
  	// Construct and send the login authentication
  	infos := s.server.NodeInfo()
  
  	var network, protocol string
  	if info := infos.Protocols["eth"]; info != nil {
  		network = fmt.Sprintf("%d", info.(*eth.NodeInfo).Network)
  		protocol = fmt.Sprintf("eth/%d", eth.ProtocolVersions[0])
  	} else {
  		network = fmt.Sprintf("%d", infos.Protocols["les"].(*les.NodeInfo).Network)
  		protocol = fmt.Sprintf("les/%d", les.ClientProtocolVersions[0])
  	}
  	auth := &authMsg{
  		ID: s.node,
  		Info: nodeInfo{
  			Name:     s.node,
  			Node:     infos.Name,
  			Port:     infos.Ports.Listener,
  			Network:  network,
  			Protocol: protocol,
  			API:      "No",
  			Os:       runtime.GOOS,
  			OsVer:    runtime.GOARCH,
  			Client:   "0.1.1",
  			History:  true,
  		},
  		Secret: s.pass,
  	}
  	login := map[string][]interface{}{
  		"emit": {"hello", auth},
  	}
  	if err := websocket.JSON.Send(conn, login); err != nil {
  		return err
  	}
  	// Retrieve the remote ack or connection termination
  	var ack map[string][]string
  	if err := websocket.JSON.Receive(conn, &ack); err != nil || len(ack["emit"]) != 1 || ack["emit"][0] != "ready" {
  		return errors.New("unauthorized")
  	}
  	return nil
  }
docs: // login tries to authorize the client at the remote server.