Establishing a connection to DUKASCOPY using stunnel
在通过 FIX4.4 协议使用 stunnel 和 quickfix python 与我的经纪人 DUKASCOPY 建立连接时寻求帮助。
这是我的 stunnel 配置:
1
2 3 4 5 6 |
client = yes
cert = /etc/stunnel/stunnel.pem [OKSERVER] |
我的快速修复 cfg 文件:
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[DEFAULT]
ConnectionType=initiator LogonTimeout=30 ReconnectInterval=30 ResetOnLogon=Y FileLogPath=./Logs/ [SESSION] |
当我尝试登录时,我得到:
1
2 3 4 5 |
20181002–22:26:23.972817000 : Created session
20181002–22:26:23.978505000 : Connecting to demo-api.dukascopy.com on port 10443 (Source :0) 20181002–22:26:24.023770000 : Initiated logon request 20181002–22:26:24.065703000 : Socket Error: Connection reset by peer. 20181002–22:26:24.065799000 : Disconnecting |
我可以确认我正在监听传入端口:
1
2 |
~/qfsample/quickfix-python-sample$ netstat -an | grep 9443
tcp 0 0 0.0.0.0:9443 0.0.0.0:* LISTEN |
我还在路由器上配置了 9443 端口转发到客户端机器。
以下是我从应用程序收到的消息:
1
2 |
onCreate(self=<__main__.Application; proxy of <Swig Object of type ‘FIX::Application *’ at 0x7f87db719030> >, sessionID=<quickfix.SessionID; proxy of <Swig Object of type ‘FIX::SessionID *’ at 0x7f87db6674e0> >)
toAdmin(self=<__main__.Application; proxy of <Swig Object of type ‘FIX::Application *’ at 0x7f87db719030> >, sessionID=<quickfix.Message; proxy of <Swig Object of type ‘FIX::Message *’ at 0x7f87db667e70> >, message=<quickfix.SessionID; proxy of <Swig Object of type ‘FIX::SessionID *’ at 0x7f87db667d20> >) |
非常欢迎您在此处找到问题的任何帮助!
- 还可以考虑在 stunnel 中使用 verify checkHost CAfile 选项,以检查证书信任链返回到 CA …
好的。所以我想我要么从这个伟大的论坛获得一些帮助,要么自己解决这个问题是不可避免的!在这种情况下是后者!
这是我出错的地方:
当您使用 stunnel 创建隧道时,您必须将目标设置到本地计算机上您在 stunnel 配置中为”接受”创建的端口,而不是代理的地址。现在很明显!这是我的 cfg 文件现在的样子:
1
2 |
SocketConnectPort=9443
SocketConnectHost=localhost |
- 感谢您发布您的答案。那么,我是否正确地说您将您的发起者指向 stunnel,然后在您的 stunnel 配置中使用 IP 和端口作为交易场所?
- @p.luck:正确:FIX -> Stunnel -> 交易场所
感谢@Jaspal 发布您的 Q
来源:https://www.codenong.com/52617392/