Skip to content

Conversation

@sisou
Copy link
Collaborator

@sisou sisou commented Apr 7, 2021

Fixes #8

Adds server-side 'connection' event on socket connection (I hope that's obvious 😄). This also exposes the request in all event payloads, I don't know if that is required, necessary or even wanted? Might be helpful to check for custom headers in a server implementation on certain message events?

@sisou sisou changed the title Emit "connection" and "disconnect" events, expose request in events Emit "connection" and event, expose request in events Apr 7, 2021
@JohanWinther
Copy link
Owner

JohanWinther commented Apr 8, 2021

This also exposes the request in all event payloads, I don't know if that is required, necessary or even wanted? Might be helpful to check for custom headers in a server implementation on certain message events?

I have an idea to add an options param to the Websocket server constructor in order to specify what to return in the event payload. By default it should return the current objects for compatibility.

Do you think that is a good idea?

@sisou
Copy link
Collaborator Author

sisou commented Apr 9, 2021

Jup, I agree, will update this PR.

@sisou sisou force-pushed the sisou/connection-events branch from 97ff3f1 to 5500a53 Compare April 9, 2021 11:03
@sisou sisou changed the title Emit "connection" and event, expose request in events Emit "connection" event on server when a socket connects Apr 9, 2021
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.

Provide connection events

2 participants