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

Secure streams: ws protocol always "GET //" #3318

Open
chenuduss opened this issue Jan 23, 2025 · 3 comments
Open

Secure streams: ws protocol always "GET //" #3318

chenuduss opened this issue Jan 23, 2025 · 3 comments

Comments

@chenuduss
Copy link

chenuduss commented Jan 23, 2025

Secure streams 4.3.3 (4415e84c095857629863804e941b9e1c2e9347ef)

Policy JSON

{"release":"01234567","product":"w_agent","schema-version":1,"retry":[{"default":{"backoff":[1000,2000,3000,5000,10000],"conceal":5,"jitterpc":20,"svalidping":60,"svalidhup":64}}],"certs": [],"trust_stores": [],"s":[{"agent_connector": {"endpoint":"127.0.0.1","port": 10087,"protocol":"ws","http_url":"/agent_ws?instance_id=04ba2d147276bfeb2ed7fcaa68a7c361","nailed_up":true,"tls": false,"ws_prioritize_reads":true,"ws_binary": true,"retry":"default"}}]}

RESULT: ws-protocol always "GET //"

logs1.txt (git-hash of version is related with my local git server)

Image

@chenuduss chenuduss changed the title Secure strems: ws protocol always "GET //" Secure streams: ws protocol always "GET //" Jan 23, 2025
@chenuduss
Copy link
Author

chenuduss commented Jan 24, 2025

So, I looked at the code of the lws_generate_client_handshake() function. And I was very surprised. Function implies that if the request method is specified, the websocket protocol is ignored. I did not expect such a ridiculous behavior from such a well-thought-out and old library. What if the websocket server accepts connections only via PUT or POST? This is absolutely inflexible!

Image

@chenuduss
Copy link
Author

chenuduss commented Jan 24, 2025

After reviewing the library sources, I learned that it turns out that the "endpoint" field can specify a full link in the format "ws://host:port/uri". But what struck me most was that this was not specified anywhere in the documentation. In the large, detailed and well-formatted documentation, it is not explained that the "endpoint" field can specify a full link. There are many examples in the repository related to Secure streams, but of them, ONLY ONE example is directly dedicated to websocket (the example with binance), and in that example, the link is specified via the "http_url" field. This looks more like a plot of a comedy movie.

Image

@lws-team
Copy link
Member

It'd be great if you first understood a few basic points before sharing your galaxy-brain thoughts.

  • the difference between a git tag, which is an immutable tree, and a development branch, in this case main, which "develops" over time. There are literally years of work / fixes on main that doesn't exist on v4.3-based branches. In particular, the main examples are now SS ones. So it's not a great idea to use an old tag and even less of a good idea to thump the table about its state, since nobody gives a shit.

  • the LICENSE, which makes it clear nobody owes you anything, not even the time of day for your thoughts, or any stubbed toes you might encounter

  • similarly, nobody owes you or anyone else any work. SS was paid for by a rich customer, it suited their needs. When they stopped paying, I broadly stopped working on it. Feel I should work on it for free? I have done so, eg for lhp integration but currently, I have no reason to. You're welcome to use some other solution if it isn't meeting your high standards.

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

No branches or pull requests

2 participants