Skip to content

Websocket support#89

Open
albertok wants to merge 4 commits intofoxssake:mainfrom
albertok:websocket-support
Open

Websocket support#89
albertok wants to merge 4 commits intofoxssake:mainfrom
albertok:websocket-support

Conversation

@albertok
Copy link
Contributor

Resolves #86 by providing a means for a websocket client to connect.

A simple websocket proxy is created on the server side which relays incoming connections to trimsock.

I refactored the nohub client so its extendable and different kinds of transports can be implemented.

There is now a tcp and websocket client which can be used as drop in replacements of each other.

@albertok albertok marked this pull request as ready for review December 27, 2025 03:25
@albertok
Copy link
Contributor Author

@elementbound This is ready for review. All features work via TCP and Websocket in the example browser project.


private async startWebSocketServer() {
if (!this.nohub) {
throw new Error("WebSocket module not attached to nohub instance");
Copy link
Contributor

@elementbound elementbound Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could lead to an uncaught promise rejection which crashes the process, will have to check.

( Even though it's technically never supposed to happen )

}
},
error(socket, error) {
rootLogger.error({ error }, "TCP socket error in WebSocket proxy");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the module's own logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nohub can not connect via web browser

2 participants