Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.


Folders and files

Last commit message
Last commit date

Latest commit



42 Commits

Repository files navigation

Build Status


Package tcp_server created to help build TCP servers faster.

Install package

go get -u


NOTICE: OnNewMessage callback will receive new message only if it's ending with \n

package main

import ""

func main() {
	server := tcp_server.New("localhost:9999")

	server.OnNewClient(func(c *tcp_server.Client) {
		// new client connected
		// lets send some message
	server.OnNewMessage(func(c *tcp_server.Client, message string) {
		// new message received
	server.OnClientConnectionClosed(func(c *tcp_server.Client, err error) {
		// connection with client lost



To hack on this project:

  1. Install as usual (go get -u
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Ensure everything works and the tests pass (go test)
  4. Commit your changes (git commit -am 'Add some feature')

Contribute upstream:

  1. Fork it on GitHub
  2. Add your remote (git remote add fork
  3. Push to the branch (git push fork my-new-feature)
  4. Create a new Pull Request on GitHub

Notice: Always use the original import path by installing with go get.