GithubHelp home page GithubHelp logo

chatie / io Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 196 KB

Chatie Cloud Input/Output Service

Home Page: https://npmjs.com/package/@chatie/io

License: Apache License 2.0

TypeScript 94.09% Shell 5.59% JavaScript 0.32%
wechaty chatie chatbot cloud

io's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

windmemory

io's Issues

Puppet WXWork Service unreachable

Interesting find out:

https://api.chatie.io/v0/hosties/puppet_wxwork_xxx

{"host":"127.0.0.1","ip":"x.y.217.105","port":8788}

It seems that the service discovery thinks that the Puppet Service Service IP is not public accessible.

Related source code:

io/src/server/io-manager.ts

Lines 362 to 375 in 17c715f

/**
* Huan(202201): test whether the puppet service server host/port
* can be visited by the internet
*/
const isReachable = await isPortReachable(port, {
host,
timeout: 5 * 1000,
})
const data = {
host: isReachable ? host : '127.0.0.1',
ip: host, // <- `ip` is deprecated, use `host` instead. Will be removed after Dec 31, 2022 Huan(202108)
port,
}

Originally posted by @huan in Chatie/server#96 (comment)

Keep service discovery information after the websocket disconnect for a while

If a Puppet Service Server is restarting, the WebSocket connection to the io will be lost for a while.

We should keep the old information available for a period of time, so that:

  1. It will be able to be discovered between the restarting of the service server,
  2. It will timeout after a period of time.

The exact timeout number needs to be investigated. (we can refer to the configuration of etcd or zookeeper)

CC @windmemory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.