// Connect func (system *_System) Connect(name string, raddr string) (gorpc.Client, error) { builder := gorpc.NewClientBuilder( name, gorpc.BuildPipeline(time.Millisecond*10).Handler( "profile", gorpc.ProfileHandler, ).Handler( "tunnel-client", func() gorpc.Handler { return system.newTunnelClient(raddr) }, ).Timeout(system.timeout), ) builder.Reconnect(system.timeout) return gorpc.TCPConnect(builder, name, raddr) }
func() gorpc.Handler { return stateHandler }, ), ) var clientBuilder = gorpc.NewClientBuilder( "test-client", gorpc.BuildPipeline(time.Millisecond*10).Handler( "dh-client", func() gorpc.Handler { return handler.NewCryptoClient(gorpc.NewDevice(), handler.NewDHKey(G, P)) }, ).Handler( "heatbeat-client", func() gorpc.Handler { return handler.NewHeartbeatHandler(5 * time.Second) }, ), ) var upgrader = websocket.Upgrader{} // use default options func api(w http.ResponseWriter, r *http.Request) { c, err := upgrader.Upgrade(w, r, nil) if err != nil {