Handle server live authentication inside WebSocket connection #67

Closed
opened 2026-04-30 23:50:50 +00:00 by luca0N · 2 comments
Owner

The WebSocket API does not offer any functionality for specifying headers. As such, the current authentication check implemented in the live endpoint handler cannot be used in any browser.

The server should perform session validation after a WebSocket connection has been established.

The [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket) does not offer any functionality for specifying headers. As such, the current authentication check implemented in the live endpoint handler cannot be used in any browser. The server should perform session validation after a WebSocket connection has been established.
luca0N self-assigned this 2026-04-30 23:50:50 +00:00
luca0N added this to the v1.0.0 project 2026-04-30 23:50:50 +00:00
Author
Owner

Added #56 as a dependency, as otherwise the current code would be too long, complex, prone to errors and bugs, and would be quite lacking in code quality.

I am planning on refactoring WebSocket I/O operations, more specifically.

Added #56 as a dependency, as otherwise the current code would be too long, complex, prone to errors and bugs, and would be quite lacking in code quality. I am planning on refactoring WebSocket I/O operations, more specifically.
Author
Owner

I am currently taking this rework as an opportunity to have an initial handshake instead of having the client send the protocol version in every single packet1.


  1. // TODO: remove Version from the packet; there is no need to send this in

    ↩︎

I am currently taking this rework as an opportunity to have an initial handshake instead of having the client send the protocol version in every single packet[^1]. [^1]: https://git.luca0n.com/luca0N/lanbassador/src/commit/2bc8b9e5bf6f573c367930702ccb3b671929d708/server/ws.go#L76
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
luca0N/lanbassador#67
No description provided.