Setting up a remote connection gateway with IBridgePy allows you to connect to Interactive Brokers from any machine on your network. This guide explains how to configure remote connections for algorithmic trading using IB API.

Special thanks to user of geeeeeeek !
The original question was raised by geeeeeeek and it was answered by her/him later.
The original question was “Instead of localhost connection, can we connect IB gateway remotely?”
How to Set Up Remote IB Gateway Connection
The answer is YES.
In RUN_ME.py, add remoteHostIP=’xx.xx.xx.xx’ (xx is your real remote host IP).
Also, you need to disable “localhost host connection only” option in your IB gateway first and then add trusted IP in the list before you do the remote connection. Learn more in our tutorials.
For more information, visit Python official documentation.
