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

Does this project provide a solution for connecting to a web socket? #41

Open
NabiKAZ opened this issue Apr 2, 2022 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@NabiKAZ
Copy link

NabiKAZ commented Apr 2, 2022

Does this project provide a solution for connecting to a web socket?
For example, I need an example like this in nodejs:

var socket = new WebSocket(url);
socket.onopen = function() {
...
};
socket.onmessage = function(e) {
...
};

The url in that example is on cloudflare.

@lwthiker
Copy link
Owner

lwthiker commented Apr 3, 2022

Unfortunately it seems that curl doesn't implement websockets yet even though it's a highly requested feature: See here https://github.com/curl/curl/wiki/WebSockets

You can send the initial HTTP request with the 'Upgrade: websocket' header using curl but if you want to receive or send messages I think you are out of luck.

To make this work it should probably be a separate project, possibly modifying Node or another Websocket implementation to behave like curl-impersonate when opening TLS connections.

kianmeng pushed a commit to kianmeng/curl-impersonate that referenced this issue Aug 19, 2022
@zer0def
Copy link

zer0def commented Nov 12, 2022

Don't mean to jump the gun too hard (it's been only ~two weeks since it was released), but I've noticed that curl 7.86.0 has shipped with experimental websocket support, so just wanted to check whether it's something on your radar?

@lwthiker
Copy link
Owner

I was aware of the work being done but wasn't aware that it already landed in a release. These are good news! I would definitely attempt to upgrade to 7.86. It would be interesting to see if the impersonation works for websockets easily.

@lwthiker lwthiker added the enhancement New feature or request label Dec 8, 2022
@OEvans117
Copy link

Interested if you guys are thinking about implementing this :)

@lwthiker
Copy link
Owner

Now that curl has websocket support, I'm attempting to implement it as part of #160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants