lwthiker / curl-impersonate

curl-impersonate: A special build of curl that can impersonate Chrome & Firefox
MIT License
3.45k stars 229 forks source link

WS/WSS Protocol in Docker Image #212

Closed Snusmumr1000 closed 4 months ago

Snusmumr1000 commented 6 months ago

Hello,

First of all, thank you for your project, it is really helpful.

I want to use curl-impersonate for WS/WSS using your Docker image.

When I tried to connect to WSS, the following error was thrown:

docker run --rm lwthiker/curl-impersonate:0.6.0-alpha.1-chrome-slim-bullseye curl_chrome101 "wss://example.com/endpoint"

curl: (1) Protocol "wss" not supported or disabled in libcurl

Then I checked the supported protocols:

docker run --rm lwthiker/curl-impersonate:0.6.0-alpha.1-chrome-slim-bullseye curl_chrome101 -V

curl 8.1.1 (x86_64-pc-linux-gnu) libcurl/8.1.1 BoringSSL zlib/1.2.11 brotli/1.0.9 nghttp2/1.56.0
Release-Date: 2023-05-23
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe UnixSockets

Seems like the curl was built without --enable-websockets option.

Could this be fixed in some way please?

Snusmumr1000 commented 6 months ago

The same happens when I try to build Docker image locally from master:

docker build -t curl-impersonate-ff firefox
docker run --rm curl-impersonate-ff curl_ff100 -V

curl 8.1.1 (aarch64-unknown-linux-gnu) libcurl/8.1.1 NSS/3.92 zlib/1.2.13 brotli/1.0.9 nghttp2/1.56.0
Release-Date: 2023-05-23
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe UnixSockets

Maybe any ideas what am I doing wrong, anyone?

nexus7080 commented 5 months ago

have you found a solution?

lwthiker commented 4 months ago

There was indeed a bug in the Docker build. The fix will be available in the next publicly released Docker image. Currently available for local builds.