Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
github.com/txthinking/socks5
SOCKS Protocol Version 5 Library.
Full TCP/UDP and IPv4/IPv6 support. Goals: KISS, less is more, small API, code is like the original protocol.
❤️ A project by txthinking.com
$ go get github.com/txthinking/socks5
type NegotiationRequest struct
func NewNegotiationRequest(methods []byte)
, in clientfunc (r *NegotiationRequest) WriteTo(w io.Writer)
, client writes to serverfunc NewNegotiationRequestFrom(r io.Reader)
, server reads from clienttype NegotiationReply struct
func NewNegotiationReply(method byte)
, in serverfunc (r *NegotiationReply) WriteTo(w io.Writer)
, server writes to clientfunc NewNegotiationReplyFrom(r io.Reader)
, client reads from servertype UserPassNegotiationRequest struct
func NewUserPassNegotiationRequest(username []byte, password []byte)
, in clientfunc (r *UserPassNegotiationRequest) WriteTo(w io.Writer)
, client writes to serverfunc NewUserPassNegotiationRequestFrom(r io.Reader)
, server reads from clienttype UserPassNegotiationReply struct
func NewUserPassNegotiationReply(status byte)
, in serverfunc (r *UserPassNegotiationReply) WriteTo(w io.Writer)
, server writes to clientfunc NewUserPassNegotiationReplyFrom(r io.Reader)
, client reads from servertype Request struct
func NewRequest(cmd byte, atyp byte, dstaddr []byte, dstport []byte)
, in clientfunc (r *Request) WriteTo(w io.Writer)
, client writes to serverfunc NewRequestFrom(r io.Reader)
, server reads from clienttype Reply struct
func NewReply(rep byte, atyp byte, bndaddr []byte, bndport []byte)
, in serverfunc (r *Reply) WriteTo(w io.Writer)
, server writes to clientfunc NewReplyFrom(r io.Reader)
, client reads from servertype Datagram struct
func NewDatagram(atyp byte, dstaddr []byte, dstport []byte, data []byte)
func NewDatagramFromBytes(bb []byte)
func (d *Datagram) Bytes()
This can satisfy the classic scenario, and it is still recommended that you choose the above small API to customize for special scenarios.
Server: support both TCP and UDP
type Server struct
type Handler interface
TCPHandle(*Server, *net.TCPConn, *Request) error
UDPHandle(*Server, *net.UDPAddr, *Datagram) error
Example:
server, _ := NewClassicServer(addr, ip, username, password, tcpTimeout, udpTimeout)
server.ListenAndServe(Handler)
Client: support both TCP and UDP and return net.Conn
type Client struct
Example:
client, _ := socks5.NewClient(server, username, password, tcpTimeout, udpTimeout)
conn, _ := client.Dial(network, addr)
Licensed under The MIT License
FAQs
Unknown package
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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.