Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transport options/headers for server-to-server use case #534

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

avistramer
Copy link

This PR adds support for passing additional transport options like headers for all transports except websockets and also receiving an info event when the /info response is received.

The use case here is to support cookie-based session stickiness when the client is running in Node.js and the server is behind an AWS ALB or another LB that uses cookie-based session stickiness.

This setup is really useful for setting up streaming between two processes across the internet that need to communicate in real-time but have to account for corporate proxies in the middle breaking any attempt at a true streaming connection.

There is a bit of a philosophical question here on whether this project wants to support this use case at all, but if you do then having some way to simulate the cookie process in the browser when using the fallback transports is a necessity.

Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

is the PR ready for review?

…compliant with Writeable api that allows for handling back pressure
@avistramer
Copy link
Author

is the PR ready for review?

Hi @auvipy yes it is. It was opened 3.5 years ago to get this working as a Node.js client communicating with a Sockjs server that sits behind an LB (see original description).

When no one responded we ended up just releasing it on our own as a separate package with the change.

Recently had to make one more change to make it handle back pressure in the standard Node.js way (calling write/send to the stream returns false when it can't accept any more data and then fires a drain event when ready for more data). faye-websocket support this but it was not visible via the wrapper.

@auvipy
Copy link

auvipy commented Nov 4, 2024

Im actually a new maintainer so willing to know its state to merge it

@avistramer
Copy link
Author

Thanks @auvipy. I would love to see this get reviewed and merged so we can stop maintaining a separate fork with these changes included.

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