IbcAlpha / IBC

Automation of Interactive Brokers TWS. You can download the latest release here: https://github.com/ibcalpha/ibc/releases/latest
GNU General Public License v3.0
1.02k stars 178 forks source link

Can't comunicate with the gateway from remote host #195

Closed AmitKehat closed 1 year ago

AmitKehat commented 1 year ago

Hello, I am running IBC on server successfully. I added in the gateway settings the remote IP of the client machine I want to operate from.

In the client machine I am trying to run ib_insync and connect to gateway:

` import ib_insync

ib = ib_insync.IB() ib.connect('', 4001, clientId=10) `

The output I am getting is: API connection failed: TimeoutError() Traceback (most recent call last): File ".\ib_insinc_test.py", line 4, in <module> ib.connect('<SERVER_HOST>', 4001, clientId=10) File "C:\Users\amitk\Documents\repositories\easyib\venv\lib\site-packages\ib_insync\ib.py", line 269, in connect return self._run(self.connectAsync( File "C:\Users\amitk\Documents\repositories\easyib\venv\lib\site-packages\ib_insync\ib.py", line 308, in _run return util.run(*awaitables, timeout=self.RequestTimeout) File "C:\Users\amitk\Documents\repositories\easyib\venv\lib\site-packages\ib_insync\util.py", line 341, in run result = loop.run_until_complete(task) File "C:\Users\amitk\anaconda3\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "C:\Users\amitk\Documents\repositories\easyib\venv\lib\site-packages\ib_insync\ib.py", line 1674, in connectAsync await self.client.connectAsync(host, port, clientId, timeout) File "C:\Users\amitk\Documents\repositories\easyib\venv\lib\site-packages\ib_insync\client.py", line 211, in connectAsync await asyncio.wait_for(self.conn.connectAsync(host, port), timeout) File "C:\Users\amitk\anaconda3\lib\asyncio\tasks.py", line 490, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError (I replaced my real server IP with: )

Any idea how can I overcome this issue?

Thanks, Amit

rlktradewright commented 1 year ago

IBC has absolutely nothing to do with client API connections (apart from the fact that you can configure the API port using IBC).

So I think you need to post your issue on the ib_insync User Group.