Skip to content

Repository files navigation

Release Reference DeepWiki Test

Insights Insights

go-l4proxy

Layer4, TCP and UDP, proxy servers and library for Go.

Features

  • TCP server
  • TCP proxy
  • UDP server
  • UDP proxy
  • High performance

Usages

TCP Server and proxy

svr := &tcp.Server{
    Addr:    ":8000",
    Handler: tcp.NewProxy("localhost:9000"),
}

if err := svr.ListenAndServe(); err != nil && err != tcp.ErrServerClosed {
    panic(err)
}

UDP Server and proxy

svr := &udp.Server{
    Addr:    ":8000",
    Handler: udp.NewProxy("localhost:9000"),
}

if err := svr.ListenAndServe(); err != nil && err != udp.ErrServerClosed {
    panic(err)
}

Docs & Examples

References