You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constib=require('ib');letclient=newib({clientId : 1,host : 'my public ip',port : 7497});client.connect();client.on('connected',()=>{console.log("success");}).on("error",()=>{console.log("error");});
it does not work in this case , my TWS are configured to receive from external IPs, not only the localhost (I also added my DigitalOcean server public ip to my TWS trusted IPs)
DigitalOcean blocks all the ports by default (except 80) , I also opened 7497
but still the same issue
The text was updated successfully, but these errors were encountered:
This isn't really a question about this library; it's about connectivity. The library doesn't do anything different depending on where it's run. I've been running it for years both locally and on VPSes.
I also added my DigitalOcean server public ip to my TWS trusted IPs
If TWS runs on the DO server, you need to add your client's public IP to the TWS trusted IPs list, not your DO server's IP.
Anyway, that's an insecure setup. I wouldn't trust TWS's SSL. They make it optional to begin with, which is patently stupid.
A secure setup is to only allow TWS to accept connections from localhost, then setup port forwarding on your PC using ssh -nNT -L 7497:localhost:7497 <yourServerIp>. That way you don't need to open port 7497 on the server; only the SSH port (which you should change to a random number above 1024 for additional security).
Also, you probably want to run Gateway v972 (not later because IB fucked it up and it disconnects every day) on the server, and use IBC Alpha to keep it running indefinitely.
here's my codes
in localhost and it works well
here , it's hosted in DigitalOcean server
it does not work in this case , my TWS are configured to receive from external IPs, not only the localhost (I also added my DigitalOcean server public ip to my TWS trusted IPs)
DigitalOcean blocks all the ports by default (except 80) , I also opened 7497
but still the same issue
The text was updated successfully, but these errors were encountered: