sSSG is a socket server written in Go (Golang). It features a configurable light-weight with dashboard to check the server status. If you want to build a socket server with no more limits, then you can try this.
Golang 1.9 and above
go get -u -v github.com/weizhe0422/Simple-Socket-Server-with-Golang
- check the ./server/main/server.json, and modify the setting value to meet your situation
- type
cd ./main
to swtich to main function file :server.go
- type
go run server.go
to start up the server to liesten
- check the ./client/main/client.json, and modify the setting value to meet your situation
- type
cd ./main
to swtich to main function file :client.go
- type
go run client.go
to start up the client - type the message even multi-line, and use
quit
to send to server
- connectMethod: Method that server supply, ex:
tcp
orudp
. - serverAddress: IP Address that server host, ex:
localhost
. - socketPort: Port that server supply, ex:
5000
. - receiveBuffer: Receive buffer to reveive message, the unit is byte, ex:
512
. - httpPort: HTTP server port to supply external API to
GET
server status, ex:4000
. - serverStatusPath: Route path to supply external API to
GET
server status, ex:/server/status
. - apiSvrReadTimeOut: API server time out to read, the uite is millisecond, ex:
5000
. - apiSvrWriteTimeOut: API server time out to write, the uite is millisecond, ex:
5000
. - rateLimitPerSecond: connection count per second, ex:
30
. - rateLimitBuffer: buffer for rate limit, ex:
1
. - webRoot: folder path that static HTML page saved, ex:
./webPage
.
- connectMethod: Method to connect to server, ex.
tcp
orudp
. - clientAddress: Server address that want to connect, ex:
localhost
. - connectionPort: Server address port.
- Server can serve multiple connections at the same time.
- Configurable setting.
- Support rate limit machanism to limit connection request count per second
- Dashboard to display the server status include
- Current total connection count
- Session status with every session id
- Can also get the status raw dat with HTTP
GET
method.
- Gracfully disconnect with client
- Use etcd to save the configuration setting, then you can change it with remote and works immediately.
- Support log to save into Mongo.
- Client can input multi-line text and send to server with
quit
command.
- Web form interface for user to input message