Echo

v0.1.2

Go Reference

What

TCP Echo server. RFC862 implementation.

Usage of package

package main

import (
	"context"

	"github.com/boratanrikulu/echo"
)

func main() {
	s := echo.NewServer().
		Address(":1337").
		Banner(true).
		Verbose(false)

	ctx := context.Background()
	s.Run(ctx)
}

Usage of CLI

               _
              | |
  ___    ___  | |__     ___
 / _ \  / __| | '_ \   / _ \
|  __/ | (__  | | | | | (_) |
 \___|  \___| |_| |_|  \___/

Usage: echo [options]
Options:
	-a,  --address,   which interface and port will be used  *[example: ":1337"]
	-n,  --no-banner
	-v,  --verbose
	-h,  --help

* means "must be set".

Live Demo

It lives at echo.bora.sh:1337.
You can try it using telnet.

telnet echo.bora.sh 1337

Development

To run tests,

go test ./... -v -cover -count=1 -race

To run server,

go run ./cmd --address :1337

To run server with Docker,

docker build -t echo .

docker run --rm -i -t -p 1337:1337 echo --address :1337

GitHub

https://github.com/boratanrikulu/echo