Socket
Socket
Sign inDemoInstall

github.com/things-go/go-socks5

Package Overview
Dependencies
5
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/things-go/go-socks5


Version published

Readme

Source

go-socks5

GoDoc Go.Dev reference Action Status codecov Go Report Card License Tag

Provides the socks5 package that implements a SOCKS5. SOCKS (Secure Sockets) is used to route traffic between a client and server through an intermediate proxy layer. This can be used to bypass firewalls or NATs.

Feature

The package has the following features:

  • Support socks5 server
  • Support TCP/UDP and IPv4/IPv6
  • Unit tests
  • "No Auth" mode
  • User/Password authentication optional user addr limit
  • Support for the CONNECT command
  • Support for the ASSOCIATE command
  • Rules to do granular filtering of commands
  • Custom DNS resolution
  • Custom goroutine pool
  • buffer pool design and optional custom buffer pool
  • Custom logger

TODO

The package still needs the following:

  • Support for the BIND command

Installation

Use go get.

    go get github.com/things-go/go-socks5

Then import the socks5 server package into your own code.

    import "github.com/things-go/go-socks5"

Example

Below is a simple example of usage, more see example

package main

import (
	"log"
	"os"

	"github.com/things-go/go-socks5"
)

func main() {
	// Create a SOCKS5 server
	server := socks5.NewServer(
		socks5.WithLogger(socks5.NewLogger(log.New(os.Stdout, "socks5: ", log.LstdFlags))),
	)

	// Create SOCKS5 proxy on localhost port 8000
	if err := server.ListenAndServe("tcp", ":8000"); err != nil {
		panic(err)
	}
}

Reference

License

This project is under MIT License. See the LICENSE file for the full license text.

FAQs

Last updated on 11 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc