diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a460645 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "go.inferGopath": false +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7843475..57d10d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM alpine:latest -MAINTAINER caiyu "a7458969@gmail.com" WORKDIR /home/ubuntu/api/bin @@ -9,4 +8,4 @@ RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 EXPOSE 9850 -ENTRYPOINT ["/bin/go-tcpFramework-rudy","--conf_path=/bin/TcpServConfig.json"] \ No newline at end of file +ENTRYPOINT ["/bin/go-tcpFramework-rudy","--conf_path=/bin/TcpServConfig.json"] diff --git a/README.md b/README.md index d57871a..9a92670 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,17 @@ -## go-tcpFramework-rudy - #### 介绍 - -基于 golang 的 tcp 长连接框架--rudy。 - -#### 软件架构 - +tcp流转包服务端 +#### 特性 功能: -提供连接数管理,支持熔断,热重启 -提供路由管理,支持 context 化 timeout 和 cancel -支持分布式,和主节点选举 -支持 apolo 配置 -心跳包支持 -服务端推送支持 - +提供连接数管理,支持熔断,热重启。 +支持 context 化回调机制。 +##### 支持分布式,和主节点选举。 +主节点的作用 +心跳包支持。 +服务端推送支持。 +##### 可选并行回调或者同步回调方式。 +并行回调就是异步回调,回调不保证执行得有序性。 +同步回调一定会在上个回调函数执行完毕后执行。 #### How to use - ```go package main @@ -63,13 +59,10 @@ server.Run() 服务启动 包头格式 7 个字节,首个字节标识符 40 41 ,然后包长度,最后是 verify 是包头长度的校验和 ### secure tcp - secure tcp 提供了类似于 tls,ssl 的机制的安全 tcp 连接,流程如下

![image.png](https://www.testingcloud.club/sapi/api/image_download/692bf256-e121-11ea-bc55-525400dc6cec.png) -
-#### 服务端下发公钥的报文 diff --git a/deploy.bat b/deploy.bat index c058332..d1a3936 100644 --- a/deploy.bat +++ b/deploy.bat @@ -10,4 +10,5 @@ ssh -t -i ./id_rsa ubuntu@118.24.238.198 'cp /home/ubuntu/api/bin/go-tcpFramew ssh -t -i ./id_rsa root@118.24.238.198 'cd /home/ubuntu/api/bin/;docker build ./ -t "caiyuzheng\rudy"' ssh -t -i ./id_rsa ubuntu@118.24.238.198 'chmod 777 /home/ubuntu/api/bin/rudy' -ssh -t -i ./id_rsa ubuntu@118.24.238.198 '/home/ubuntu/api/bin/restart.sh rudy' \ No newline at end of file +ssh -t -i ./id_rsa ubuntu@118.24.238.198 '/home/ubuntu/api/bin/restart.sh rudy' + diff --git a/go.mod b/go.mod index 7342307..1d9bb44 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module go-tcpFramework-rudy +go 1.14 + require ( github.com/davecgh/go-spew v1.1.1 github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 // indirect