Skip to content
Snippets Groups Projects
Commit 62fb2505 authored by Clément Pit-Claudel's avatar Clément Pit-Claudel
Browse files

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 the `WS_PORT` parameter.
* jvm/src/main/scala/cs214/webapp/server/web/WebServerRoutes.scala:
  (getAppInfo): Use `HTTP_PORT` instead of `WS_PORT` in `wsEndpoint`
  (websocket): New endpoint.
* jvm/src/main/scala/cs214/webapp/server/web/WebSocketsCollection.scala:
  Remove `java_websocket` imports.
  Change from `WebSocket` to `cask.WsChannelActor`.
  Rename `appId` to `instanceId` where appropriate.
  (WebSocketsCollection): Remove the `port` parameter.
  (connect): New function, replacing the previous `WebSocketServer` instance.
* shared/src/main/scala/cs214/webapp/Common.scala:
  (WS_PORT): Remove.
  (WebSocket): New endpoint.
parent 8970451f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment