Code Monkey home page Code Monkey logo

wserver's Introduction

支持Websocket服务器多实例的

  1. 集群动态发现
  2. 集群广播

以实现高可用,高兵法支持

配置

yaml格式

nodes:
  - name: node1 # 名称,集群内不能重复
    domain: 1.l.self.kim  # 域名, 可以配置/etc/hosts,或者直接写死IP地址
    ws_port: 50001 # 给websocket的端口, 在docker/k8s上可以用同一个
    port: 51001 # 集群发现使用的端口,不应该暴露到外网
    sequence: 1 # 集群的顺序,暂未用到
  - name: node2
    domain: 2.l.self.kim
    ws_port: 50002
    port: 51002
    sequence: 2

编译

go get github.com/golang/protobuf/protoc-gen-go
go get github.com/golang/protobuf/proto
dep ensure
go generate .
go build .

配置梯子

export http_proxy="127.0.0.1:1080"
git config --global http.proxy "127.0.0.1:1080"

运行

./wserver
./wserver --node=node2
./wserver --node=node3 --config=c.yaml

Docker

wserver's People

Contributors

qiujinwu avatar

Watchers

James Cloos avatar

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.