You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rpc.Server.ServeHTTP() calls http.Handle(rpcPath, server) and registers with http.DefaultServeMux. The second call to ServeHTTP() with the default names normally results in panic: http: multiple registrations for /_goRPC_. This means that if I want to start two different RPC endpoints on different ports I have to work around this library.
Maybe the API could be improved for a future version to support that use case without a workaround.
Like a ServeHTTPMux() that additionally takes a http.ServeMux
Go is go version go1.5.1 darwin/amd64
The text was updated successfully, but these errors were encountered:
rsc
changed the title
net/rpc: Server.ServeHTTP() not usable with multiple http servers
net/rpc: Server.ServeHTTP assumes default http mux
Dec 28, 2015
rpc.Server.ServeHTTP()
callshttp.Handle(rpcPath, server)
and registers withhttp.DefaultServeMux
. The second call to ServeHTTP() with the default names normally results inpanic: http: multiple registrations for /_goRPC_
. This means that if I want to start two different RPC endpoints on different ports I have to work around this library.Solution with workaround
Playground link
Maybe the API could be improved for a future version to support that use case without a workaround.
Like a
ServeHTTPMux()
that additionally takes ahttp.ServeMux
Go is
go version go1.5.1 darwin/amd64
The text was updated successfully, but these errors were encountered: