https://github.com/unloop/proxy
TCP proxy
https://github.com/unloop/proxy
Last synced: 8 months ago
JSON representation
TCP proxy
- Host: GitHub
- URL: https://github.com/unloop/proxy
- Owner: unloop
- License: mit
- Created: 2017-04-01T11:01:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-01T11:01:04.000Z (almost 9 years ago)
- Last Synced: 2025-03-12T00:34:43.521Z (11 months ago)
- Language: Go
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TCP proxy
Simple TCP proxy server written in Go (Golang) with logging and auth
## Usage
### CLI
```
NAME:
proxy.exe - TCP proxy server
USAGE:
proxy.exe [global options] command [command options] [arguments...]
VERSION:
0.1.0
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
-f value, --from value set proxy server port
-t value, --to value set proxy server redirect port
-a value, --auth value set proxy server auth token
-l, --log enable logging
--help, -h show help
--version, -v print the version
```
##### Start proxy server
```
$ go run proxy.go -l -f :3000 -t :5000
```
### GO
```go
package main
import (
"github.com/lavrs/proxy"
"log"
)
func main() {
server, err := proxy.NewProxyServer(proxy.Proxy{
From: ":3000",
To: ":5000",
Logging: true,
})
if err != nil {
log.Fatal(err)
}
err = server.Start()
if err != nil {
log.Fatal(err)
}
}
```