From e586115c2d6e11fb18e051d752360b4ffeb6eaa1 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Fri, 27 Jun 2014 13:39:00 +0800 Subject: [PATCH] Usage example --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index b8f9f92..9cd1563 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,23 @@ The package still needs the following: * Support for the BIND command * Support for the ASSOCIATE command + +Example +======= + +Below is a simple example of usage + +```go +// Create a SOCKS5 server +conf := &socks5.Config{} +server, err := socks5.New(conf) +if err != nil { + panic(err) +} + +// Create SOCKS5 proxy on localhost port 8000 +if err := server.ListenAndServe("tcp", "127.0.0.1:8000"); err != nil { + panic(err) +} +``` +