rpc: add pub/sub support

This commit is contained in:
Bas van Kervel
2016-03-29 15:07:40 +02:00
parent fb578f4550
commit f7328c5ecb
16 changed files with 849 additions and 315 deletions

View File

@ -93,7 +93,8 @@ func NewWSServer(cors string, handler *Server) *http.Server {
Handler: websocket.Server{
Handshake: wsHandshakeValidator(strings.Split(cors, ",")),
Handler: func(conn *websocket.Conn) {
handler.ServeCodec(NewJSONCodec(&wsReaderWriterCloser{conn}))
handler.ServeCodec(NewJSONCodec(&wsReaderWriterCloser{conn}),
OptionMethodInvocation|OptionSubscriptions)
},
},
}