TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
873 stars 228 forks source link

Error: write EPROTO 16068:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332: #136

Closed iocmet closed 1 year ago

iocmet commented 2 years ago

I trying to connect to websocket with https proxy (i tried http but i get error 400 or 403 unexpected response) my code

var url = require('url'); var WebSocket = require('ws'); var HttpsProxyAgent = require('https-proxy-agent');

// HTTP/HTTPS proxy to connect to var proxy = process.env.http_proxy || 'https://my_proxy_ip:my_proxy_port'; console.log('using proxy server %j', proxy);

// WebSocket endpoint for the proxy to connect to var endpoint = process.argv[2] || 'ws://my_socket_ip:my_socket_post'; var parsed = url.parse(endpoint); console.log('attempting to connect to WebSocket %j', endpoint);

// create an instance of the HttpsProxyAgent class with the proxy server information var options = url.parse(proxy);

var agent = new HttpsProxyAgent(options);

// finally, initiate the WebSocket connection var socket = new WebSocket(endpoint, { agent: agent });

socket.on('open', function () { console.log('"open" event!'); socket.send('hello world'); });

socket.on('message', function (data, flags) { console.log('"message" event! %j %j', data, flags); socket.close(); });

iocmet commented 2 years ago

i think it proxy problem i used my own (mitmdump) and it work but why it not work with other?

tuxorials2 commented 1 year ago

Having the same problem! Solution/Any help would be greatly appreciated!

PlasticLizard commented 1 year ago

Also having the same issue. I believe the problem is similar to the one here: https://github.com/SeleniumHQ/selenium/issues/7509 and fixed in this commit for Selenium, possibly a similar fix would work here: https://github.com/SeleniumHQ/selenium/pull/7511/commits/77ded7aa3009d61c395cf5e2efee57191d0e52ca

iocmet commented 1 year ago

UPD: I can't use mitmproxy now i getting "Error: unable to verify the first certificate"

swherden commented 1 year ago

Any update on that issue? Can't use proxy-store proxies

TooTallNate commented 1 year ago

This module has gone through a large refactor and modernization. I am closing this issue as a bit of house cleaning. If you feel that this issue still exists in the latest release, feel free to open a new issue.