Skip to content

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

Open
avistramer wants to merge 9 commits into
sockjs:mainfrom
testable:transport-headers
Open

Transport options/headers for server-to-server use case#534
avistramer wants to merge 9 commits into
sockjs:mainfrom
testable:transport-headers

Conversation

@avistramer

Copy link
Copy Markdown

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.

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

auvipy commented Nov 4, 2024

Copy link
Copy Markdown
Member

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

@avistramer

Copy link
Copy Markdown
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.

@auvipy auvipy closed this Feb 12, 2025
@auvipy auvipy reopened this Feb 12, 2025

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have started new CI builds

@auvipy

auvipy commented Feb 12, 2025

Copy link
Copy Markdown
Member

I think the PR is missing required unit tests. can you add them please?

@avistramer

Copy link
Copy Markdown
Author

Added some tests as requested

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we add additional documentation?

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