Run the HTTP and WebSocket servers on the same port
Use Cask's built-in websocket implementation instead of a separate
java_websocket
server.
- jvm/src/main/scala/cs214/webapp/server/web/WebServer.scala:
Remove theWS_PORT
parameter. - jvm/src/main/scala/cs214/webapp/server/web/WebServerRoutes.scala:
(getAppInfo): UseHTTP_PORT
instead ofWS_PORT
inwsEndpoint
(websocket): New endpoint. - jvm/src/main/scala/cs214/webapp/server/web/WebSocketsCollection.scala:
Removejava_websocket
imports.
Change fromWebSocket
tocask.WsChannelActor
.
RenameappId
toinstanceId
where appropriate.
(WebSocketsCollection): Remove theport
parameter. (connect): New function, replacing the previousWebSocketServer
instance. - shared/src/main/scala/cs214/webapp/Common.scala:
(WS_PORT): Remove.
(WebSocket): New endpoint. - shared/src/main/scala/cs214/webapp/Common.scala:
(Endpoints): Add constants for/app
and/ws
paths.