25 lines
459 B
Go
25 lines
459 B
Go
package server
|
|
|
|
import (
|
|
cwf "git.loafle.net/commons_go/websocket_fasthttp"
|
|
"git.loafle.net/overflow/overflow_gateway_app/servlet/web"
|
|
)
|
|
|
|
func New() cwf.Server {
|
|
sh := newServerHandler()
|
|
registerWebServlet(sh)
|
|
|
|
s := cwf.New(sh)
|
|
|
|
return s
|
|
}
|
|
|
|
func registerWebServlet(sh ServerHandler) {
|
|
webEntry, wsh := web.NewSocketHandler()
|
|
wsubh := web.NewSubscriberHandler(webEntry)
|
|
|
|
sh.RegisterSocketHandler(webEntry, wsh)
|
|
sh.RegisterSubscriberHandler(wsubh)
|
|
|
|
}
|