Git Product home page Git Product logo

goscon's Introduction

gosconn

特性

  • 断线重连: scp协议介绍
  • 加密: dh64密钥交换及对称流加密
  • 负载均衡
  • 命名服务路由
  • 配置热更新
  • 支持kcptcp,且可以无缝切换

用法

断线重连服务器端代理。

client <--> goscon <---> server

clientgoscon之间使用断线重连协议,goscon把客户端的请求内容转发到server

无论client因为何种原因主动或被动断开连接,goscon都会维持对应的server连接,使server感受不到client断开。

goscon维持连接期间,client可以使用断线重连协议,无缝重用之前的连接。

scp.reuse_time秒没有被重用,goscon断开跟server的连接。

编译时开启sproto扩展,新建连接后自动给后端发送一条sproto消息,宣布客户端的原始ip地址信息。

build & run & test

  • deps: go v1.13+

  • build

# normal compile
go build -mod=vendor

# enable sproto hook & debug
# go build -tags sproto,debug -mod=vendor
  • config

配置选项含义,请参考config.go

  • run
./goscon -logtostderr -v 10 -config config.yaml
  • test
  • 编译测试程序
# normal compile
go build -mod=vendor ./examples/client
  • 启动服务端
./client -startEchoServer :11248
  • 测试 tcp
./client -packets 10 -concurrent 100 -rounds 100
  • 测试 kcp
./client kcp

maintenance

可以通过默认开启的管理端口http://localhost:6620进行配置热更新,查看内部状态。

  • 热更新配置
    • 修改配置文件
    • 访问: http://localhost:6620/reload
  • 查看内部状态
    • 当前配置:http://localhost:6620/config
    • 指标: http://localhost:6620/metrics
    • kcp snmp: http://localhost:6620/kcp/snmp

goscon's People

Contributors

xjdrew avatar t0350 avatar wudeng avatar pigparadise avatar spin6lock avatar learno avatar cofyc avatar xebecnan avatar mrvon avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Forkers

cloudfreexiao

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.