Docker image for FutuOpenD on Ubuntu.
The container will start
- a FutuOpenD agent
- a websocket server which could help to check the ready status of the FutuOpend agent and make it possible for you to provide SMS verfication code.
docker pull kaelz/futuopend:latest
7.3.3508_Ubuntu16.04
- FUTU_LOGIN_ACCOUNT required
- FUTU_LOGIN_PWD_MD5 required
- FUTU_LOGIN_REGION defaults to
sh
- FUTU_LANG defaults to
chs
- FUTU_LOG_LEVEL defaults to
no
- FUTU_PORT defaults to
11111
- SERVER_PORT
integer
the port of the websocket server, defaults to8000
docker run -it -p 11111:11111 \
-e "FUTU_LOGIN_ACCOUNT=$your_futu_id" \
-e "FUTU_LOGIN_PWD_MD5=$your_password_md5" kaelz/futuopend:latest
- type
string
the type of the messages, including following types:- REQUEST_VERIFY_CODE: which means the FutuOpenD agent requires you to provide an SMS verification code
- CONNECTED: which means the FutuOpenD agent is connected
const {WebSocket} = require('ws')
const ws = new WebSocket('ws://localhost:8080')
ws.on('open', () => {
ws.on('message', msg => {
const data = JSON.parse(msg)
if (data.type === 'REQUEST_VERIFY_CODE') {
ws.send(JSON.stringify({
type: 'VERIFY_CODE',
code: '12345'
}))
}
})
})
It is not easy to connect to a container from MacOS, to run test.py
from MacOS, see:
- https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds
- docker/for-mac#2670 (comment)
docker build -t $TAG:$VERSION --build-arg .
For example:
docker build -t kaelz/futuopend:2.8.700 .