Open ccnlui opened 2 years ago
Hi @ccnlui babl will accept web-socket connections to any URI on the port. So your client should be able to connect to
ws://localhost:8080/myendpoint
or indeed
ws://localhost:8080/anything_else_you_like
however, the URI part of the request is not parsed or surfaced by the library in any way.
Header parsing is done in KeyDecoder
, which would be a reasonable place to detect/assign the request URI:
I would consider a PR that added the request URI to the session object.
Here's my attempt: https://github.com/babl-ws/babl/pull/122 I'd appreciate any feeback.
How would you implement a server endpoint?
For example, client would connect to
ws://localhost:8080/myendpoint
, instead of justws://localhost:8080
.I assumed I'd have to implement this function myself inside
onSessionConnected
, but theSession
object doesn't seem to provide any information on the client's request, I was hoping to be able to get the request's path/endpoint/query etc...How can this be done?
Thank you.