{"repo":"DarthPestilane/easytcp","free":true,"listed":false,"github":"https://github.com/DarthPestilane/easytcp","clone":"git clone https://github.com/DarthPestilane/easytcp.git","description":":sparkles: :rocket: EasyTCP is a light-weight TCP framework written in Go (Golang), built with message router. EasyTCP helps you build a TCP server easily fast and less painful.","language":"Go","stars":818,"topics":["tcp","go","golang","middleware","router","tcp-server"],"license":"MIT","category":"dev-tools","readme_excerpt":"EasyTCP Introduction EasyTCP is a light-weight and less painful TCP server framework written in Go (Golang) based on the standard net package. ✨ Features: - Non-invasive design - Pipelined middlewares for route handler - Customizable message packer and codec, and logger - Handy functions to handle request data and send response - Common hooks EasyTCP helps you build a TCP server easily and fast. This package has been tested on the latest Linux, Macos and Windows. Install Use the below Go command to install EasyTCP. Note: EasyTCP uses Go Modules to manage dependencies. Quick start If we setup with the codec Above is the server side example. There are client and more detailed examples including: - broadcasting - custom packet - communicating with protobuf in examples/tcp. Benchmark since easytcp is built on the top of golang net library, the benchmark of networks does not make much sense. Architecture Conception Routing EasyTCP considers every message has a ID segment to distinguish one another. A message will be routed according to its id, to the handler through middlewares. Register a route Using middleware Packer A packer is to pack and unpack packets' payload. We can set the Packer when creating the server. We can set our own Packer or EasyTCP uses DefaultPacker . The DefaultPacker considers packet's payload as a Size(4) ID(4) Data(n) format. Size only represents the length of Data instead of the whole payload length This may not covery some particular cases, but fortunatel","default_branch":null,"files":null,"tree":[],"storefront":"/r/DarthPestilane","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/DarthPestilane/easytcp/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}