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
Right now, returning Response.websocket("/foo/bar", wshandler) from a handler will add the "/foo/bar" -> wshandler mapping to Jetty's context mappings, so it must be a static path.
So, to mount a websocket handler on /users/<name>, you must do something like this:
This means that a mapping could be added to Jetty's table for all possible values of /users/<name>.
Even if you ensure Response.websocket() only runs if, say, a user with the given name exists in the database, that's still pretty suboptimal.
The problem is my websocket Jetty code in general. It's a pretty big hack, but I'm not familiar enough with Jetty's API to improve it just yet.
Some objectives that drove my current approach that I want to maintain:
End-user should be able to wrap a websocket endpoint behind existing middleware stacks, like inside a group or router that ensures that the user is an admin.
The websocket handler should access upstream context (like values set by upstream middleware) and the kog.Request.
The text was updated successfully, but these errors were encountered:
I'm thinking of removing the current websocket system (and the mess/hack in Server.kt) and replacing it with a simpler system where you just create a jetty websockethander and mount it separately from the req/res system.
Right now, returning
Response.websocket("/foo/bar", wshandler)
from a handler will add the"/foo/bar" -> wshandler
mapping to Jetty's context mappings, so it must be a static path.So, to mount a websocket handler on
/users/<name>
, you must do something like this:This means that a mapping could be added to Jetty's table for all possible values of
/users/<name>
.Even if you ensure
Response.websocket()
only runs if, say, a user with the given name exists in the database, that's still pretty suboptimal.The problem is my websocket Jetty code in general. It's a pretty big hack, but I'm not familiar enough with Jetty's API to improve it just yet.
Some objectives that drove my current approach that I want to maintain:
kog.Request
.The text was updated successfully, but these errors were encountered: