[真正可用] Docker image for FutuOpenD, the one that really works and could handle SMS OTPs.
3.0K
Docker image for FutuOpenD on Ubuntu, the one that really works and could handle SMS verification requests.
The container will start
The image is always built with DOCKER_DEFAULT_PLATFORM=linux/amd64 (why?) and could be docker-run on both Ubuntu and MacOS.
# Recommended (to pull an image by providing specific tag name)
docker pull ostai/futuopend:9.2.5208
Or
docker pull ostai/futuopend:latest
9.2.5208_Ubuntu16.04
string requiredstring requiredstring defaults to shstring defaults to chsstring defaults to nointeger the port of the FutuOpenD, defaults to 11111integer the port of the websocket server, defaults to 8000string="yes" whether it will initialize the Futu OpenD agent on the start, defaults to "yes"docker run \
--name FutuOpenD \
-e "SERVER_PORT=8081" \
-p 8081:8081 \
-p 11111:11111 \
-e "FUTU_LOGIN_ACCOUNT=$your_futu_id" \
-e "FUTU_LOGIN_PWD_MD5=$your_password_md5" \
ostai/futuopend:latest
const {WebSocket} = require('ws')
const ws = new WebSocket('ws://localhost:8081')
ws.on('message', msg => {
const data = JSON.parse(msg)
if (data.type === 'REQUEST_CODE') {
ws.send(JSON.stringify({
type: 'VERIFY_CODE',
code: '12345'
}))
return
}
if (data.type === 'STATUS') {
console.log('status:', data.status)
return
}
})
ws.on('open', () => {
ws.send(JSON.stringify({
type: 'STATUS'
}))
// If env FUTU_INIT_ON_START=no, we need to manually init futu
ws.send(JSON.stringify({
type: 'INIT'
}))
})
Both downstream and upstream messages are in JSON type.
{
"type": "REQUEST_CODE"
}
which means the FutuOpenD agent requires you to provide an SMS verification code
{
"type": "CONNECTED"
}
which means the FutuOpenD agent is connected
{
"type": "STATUS",
"status": -1
}
The server returns the current status to you.
{
"type": "INIT"
}
Tells the server to initialize the Futu OpenD agent, which only works when FUTU_INIT_ON_START is set to 'no'
{
"type": "STATUS"
}
Asks the server to response the current status of the server
{
"type": "VERIFY_CODE",
"code": "123456"
}
Submits the SMS verification code to Futu OpenD agent.
export VERSION=9.2.5208
export FUTU_VERSION=${VERSION}_Ubuntu16.04
TAG=ostai/futuopend
docker build -t $TAG:$VERSION \
--build-arg FUTU_VERSION=$FUTU_VERSION \
.
For example:
docker build -t ostai/futuopend:${VERSION} \
--build-arg FUTU_VERSION=${FUTU_VERSION} \
.
Content type
Image
Digest
sha256:2334cf1d9…
Size
122.8 MB
Last updated
12 months ago
docker pull ostai/futuopend