在云服务器中运行交互式代理客户端门户 API [英] Running interactive brokers client portal API in cloud server

查看:30
本文介绍了在云服务器中运行交互式代理客户端门户 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用客户端门户 Web API 从 IBKR 获取历史股票和指数价格数据.在云服务器中,我运行的是Ubuntu 18.04,并且已经配置了java运行环境.Java 版本高于最低要求.所以我可以在服务器中运行客户端门户网关.它说服务器正在 https://localhost:5000 中运行.

I am using client portal web API to get historical stocks and indices price data from IBKR. In the cloud server, I am running Ubuntu 18.04 and java runtime environment has been configured. Java version is higher than the minimum requirement. So I could run the client portal gateway in the server. Its saying that the server is running in https://localhost:5000.

我的服务器ip地址是123.176.98.246,域名是momentumdb.pro.所以我尝试访问 https://123.176.98.246:5000https://momentumdb.pro:5000/.但我无法让它工作.

My server ip address is 123.176.98.246 and domain name is momentumdb.pro. So I tried to visit https://123.176.98.246:5000 and https://momentumdb.pro:5000/. But I couldn't get it working.

我还询问了有关我使用 IBKR 帮助中心的方法的任何可能性的问题,他们回答说这是可能的,并且一些客户正在 AWS 实例中运行客户端门户 API.

I also asked questions about any possibility of my approach to IBKR help center and they replied it is possible and some clients are running client portal API in AWS instances.

如果您有使用IBKR客户端门户API并在云服务器中运行它的经验,请帮助我.谢谢

If you have an experience with IBKR client portal API and running it in cloud server, please help me. Thanks

推荐答案

来自 IBKR 客户端门户 Web API 的消息有点误导.

The message from IBKR client portal web API is kind of misleading.

Open https://localhost:5000 to login

网关实际上正在侦听您正在运行 api 网关的主机的所有接口.

The gateway is actually listening on all the interfaces of the host you are running the api gateway.

假设您运行的是 linux 或 MacOS,您可以通过运行 netstat 命令进行检查

Assuming you are running linux or MacOS, you can check by running netstat command

>> netstat -na|grep LISTEN|grep 5000
tcp6       0      0 :::5000                 :::*                    LISTEN

这表明它正在接受来自所有接口的连接.

That tells it is accepting connections from all the interfaces.

为了让您的客户端连接到 https://momentumdb.pro:5000,您需要确保网关允许客户端ip网段.

In order for your client to connect to https://momentumdb.pro:5000, you need to make sure the client ip network segment is allowed by the gateway.

签出 root/conf.yaml:

Checkout root/conf.yaml:

 ips:
  allow:
    - 192.*
    - X.Y.*
    - 127.0.0.1
  deny:
    - 212.90.324.10

根据你的客户端ip,你需要相应地替换上面的X.Y.*.

Depends on your client ip, you need to replace above X.Y.* accordingly.

一旦您进行更改并重新启动网关,它应该能够连接到

Once you make the change and restart the gateway, it should be able to connect to

https://momentumdb.pro:5000/

当然,如果该主机上有 ip 防火墙,则需要修改 iptables 规则以允许来自客户端的此类访问.

Of course, if you have ip firewall on that host, you need to modify your iptables rules to allow such access from client.

顺便说一句,来自IBKR客户端门户网关的SSL证书不受信任.出于安全原因,您可能不想冒险将其直接暴露在互联网上.

btw, the SSL certificate from IBKR client portal gateway is not trusted. You probably don't want to take the risk to expose it directly to the internet due to security reasons.

希望有帮助.

这篇关于在云服务器中运行交互式代理客户端门户 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆