Closed scorsi closed 4 years ago
Do you really need SOCKS here or are you just trying to tunnel in-process SOAP requests over SSH? If it's the latter, the code can be greatly simplified.
The SOAP server checks IP and our server hasn't IP attached (it's a Heroku serveur with Heroku domain name, we can't changed it since it's quite old and a lot of clients requests that domain name), it's why we need to use SSH tunnel to send request to the SOAP server though a server with validated IP attached.
Do you know if there's any other possible solution to achieve that without using SOCKS ?
What I meant was, is it only your node process that's making the SOAP requests?
Yep, our Heroku server (with NodeJS) have to make the request. It's on a API call that the SOAP request is sent.
Well, in the next ssh2
release there will be http(s).Agent implementations you can use to tunnel your requests instead of having to use SOCKS.
Thanks, I'll look at this and come back to you in the month. :)
Hello,
I am trying to reproduce this ssh command with node.js :
ssh -D 1080 -N user@host -I key.pem
, to use this tunnel to execute SOAP requests.My node.js implementation of SOAP API using port 1080 is as follow (and works with the ssh command launched) :
And everything works as expected like this, whether
client.describe()
andclient.example_method()
.The issue comes when trying to create the socks proxy with node. Full (censored) code below :
The description of the method example_method is well printed, so I'm sure the tunneling works (because methods can't work without it, as there is an IP restriction which accept only requests from the host server). The error comes when calling
client.example_method()
. The output is :Any idea of what is missing ? Thanks !