npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ostai/futuopend

v2.0.3

Published

[English Version](./README.en.md)

Readme

English Version

Docker Image 镜像: ostai/FutuOpenD

Build Status Coverage

真正可用的 FutuOpenD docker 镜像。

之所以创建这个项目的原因,是因为我试过很多 FutuOpenD 的 docker 镜像,要么是根本无法运行起来,要么没有处理短信验证码,或者是需要我们手动 docker exec 到容器里面处理验证码,导致根本不能够运维。

容器启动后会运行:

  • 一个 FutuOpenD agent
  • 一个 websocket 服务器,用于检查 FutuOpenD agent 的就绪状态,并支持你提供短信验证码,来进行必要的初始化

该镜像始终使用 DOCKER_DEFAULT_PLATFORM=linux/amd64 构建(why?)并可在 Ubuntu 和 MacOS 上运行。

安装

docker pull ostai/futuopend:latest

或者

docker pull ostai/futuopend:9.2.5208

最新支持的 FutuOpenD 镜像版本

9.2.5208_Ubuntu16.04

其他版本

用法

环境变量

  • FUTU_LOGIN_ACCOUNT string(必填)
  • FUTU_LOGIN_PWD_MD5 string(必填)
  • FUTU_LANG string,默认 chs
  • FUTU_LOG_LEVEL string,默认 no
  • FUTU_IP string, 默认 "0.0.0.0", 不同于 FutuOpenD CMD 的默认 IP 127.0.0.1,由于这个仓库的目的是用于 kubernetes 集群,需要让 FutuOpenD 能够接受其他容器的请求。
  • FUTU_PORT integer,FutuOpenD 的端口,默认 11111
  • SERVER_PORT integer,websocket 服务器的端口,默认 8000
  • FUTU_INIT_ON_START string="yes",容器启动时是否初始化 Futu OpenD agent,默认 "yes"
  • FUTU_SUPERVISE_PROCESS string="yes" 是否需要监控 FutuOpenD 子进程,并且在退出的时候尝试重新连接。

Docker Run:如何启动容器

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

WebSocket 服务器

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'
  }))

  // 如果环境变量 FUTU_INIT_ON_START=no,
  // 我们需要手动初始化 FutuOpenD,让它启动
  ws.send(JSON.stringify({
    type: 'INIT'
  }))
})

下行和上行消息均为 JSON 格式。

下行消息:服务器 -> 客户端

{
  "type": "REQUEST_CODE"
}

表示 FutuOpenD agent 需要你提供短信验证码

{
  "type": "CONNECTED"
}

表示 FutuOpenD agent 已连接

{
  "type": "STATUS",
  "status": -1
}

服务器返回当前状态。

{
  "type": "CLOSED"
}

表示 FutuOpenD 子进行(意外)退出

上行消息:客户端 -> 服务器

{
  "type": "INIT"
}

告诉服务器初始化 FutuOpenD agent,仅在环境变量 FUTU_INIT_ON_START 设置为 'no' 时有效

{
  "type": "STATUS"
}

请求服务器返回当前状态

{
  "type": "VERIFY_CODE",
  "code": "123456"
}

向 FutuOpenD 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 \
  .

例如:

docker build -t ostai/futuopend:${VERSION} \
  --build-arg FUTU_VERSION=${FUTU_VERSION} \
  .