Documentation
¶
Overview ¶
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Index ¶
Constants ¶
const ( AddrTypeIPv4 = 0x01 AddrTypeDomain = 0x03 AddrTypeIPv6 = 0x04 )
Address type bytes of the SOCKS5-style encoding: type | address | port (big-endian u16). A domain address carries a one-byte length (1..255) before the name.
const MaxEncodedAddrLen = 1 + 1 + 255 + 2
MaxEncodedAddrLen is the longest encoding: type, length, a 255-byte domain and the port.
Variables ¶
This section is empty.
Functions ¶
func AppendAddrPort ¶ added in v0.5.2
AppendAddrPort appends the encoding of an IP destination to dst. IPv4-mapped IPv6 addresses are encoded as IPv4 and zones are dropped.
func AppendAddress ¶ added in v0.5.2
AppendAddress appends the encoding of rawAddr ("host:port") to dst; dst is returned unchanged on error. IPv4-mapped IPv6 literals are encoded as IPv4 and IPv6 zones are dropped.
func DecodeAddress ¶ added in v0.5.2
DecodeAddress parses the address at the start of b and returns it as "host:port". IPv4-mapped IPv6 addresses are returned in dotted IPv4 form; bytes after the address are ignored.
func ReadAddress ¶
ReadAddress reads one encoded address from r without consuming bytes beyond it. It returns the "host:port" string, the address type, and the IP for IPv4/IPv6 addresses (nil for domains).
Types ¶
This section is empty.