Skip to content

Adds WebSocket server support#37

Open
dkoontz wants to merge 3 commits intogren-lang:mainfrom
dkoontz:websocket-server
Open

Adds WebSocket server support#37
dkoontz wants to merge 3 commits intogren-lang:mainfrom
dkoontz:websocket-server

Conversation

@dkoontz
Copy link

@dkoontz dkoontz commented Feb 13, 2026

Adds WebSocket server capabilities.

This is mostly modeled after the HttpServer module. There are tests but I haven't integrated it into a real application yet (going to work on gren-lang/browser#101 next so I have both parts to test with).

Adds the WebSocket module to the Node platform allowing Gren programs to create WebSocket servers and handle client connections.
@dkoontz
Copy link
Author

dkoontz commented Feb 21, 2026

I pushed a new commit addressing your comments. I also noticed that I forgot to update the integration script runner and that all the integration tests were on 0.6.2 so I updated those to 0.6.3.

@robinheghan
Copy link
Member

Hey @dkoontz , excellent stuff!

After my last review I thought of a few other things, and didn't add those comments to this issue. In any case, here they are:

  1. Did you look into using Stream for the implementation? We recently updated HttpClient to use Stream as the underlying primitive, so that's something to look at. We kinda want to use Stream wherever we can to unlock whatever synergy effects there are.

  2. Since you mention doing a WebSocket client next: do you think it would be possible to implement a Node.js compatible WebSocket client? I see v20 of Node.js and onwards have a experimental implementation of the browser API. If possible, the client could be implemented in gren-lang/core, where we eventually plan to move the node based HttpClient as well

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.

2 participants