Skip to content

Comments

Adds WebSocket server support#37

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

Adds WebSocket server support#37
dkoontz wants to merge 2 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.

{-| Convert a [`ConnectionId`](WebSocketServer.ConnectionId) to an `Int`.

Useful for storing connections in a `Dict Int Connection`.
Copy link
Member

Choose a reason for hiding this comment

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

Can't we just expose ConnectionId as Int instead of it being a opaque type? 🤔

Copy link
Author

Choose a reason for hiding this comment

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

We could, it's mostly a stylistic choice. I didn't want to leak implementation details especially since the Connection isn't directly implemented in Gren. I'm ok changing it if you have a strong opinion.

@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.

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