socks5http

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package socks5http provides listening both socks5 and http at one port.

This package imports proxy/socks5 and proxy/http package.

Naming

socks5http 与 clash的 "mixed" 等价。之所以不用 "mixed"这个名称,是因为这容易在本作中引起歧义。

clash是一个客户端,它没有服务端,所以它的监听只是用于内网监听,所以监听协议 只有http和socks5 两种,所以 它 叫 "mixed" 是没有歧义的;

而本作与v2ray一样,是支持多种服务端协议的,如果也叫 mixed 的话,会让人误以为,这是一个 "万能协议", 啥都能监听, 而这显然是误区。 命名为 socks5http, 则清晰地指出了 该协议的功能。

Password

为了避免混淆,本包不支持密码验证。你要是有这么高的密码要求 那你不妨用单独的协议,而不要用混合版。

实际上本包就是先经过http,然后如果不是http代理请求,就会回落到socks5.

所以你可以通过 设计回落的方式来达到 有密码 的 混合端口 的需求。

Index

Constants

View Source
const Name = "socks5http"

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	proxy.Base
	// contains filtered or unexported fields
}

func (*Server) Handshake

func (s *Server) Handshake(underlay net.Conn) (newconn net.Conn, msgConn netLayer.MsgConn, targetAddr netLayer.Addr, err error)

func (*Server) Name

func (*Server) Name() string

type ServerCreator

type ServerCreator struct{ proxy.CreatorCommonStruct }

func (ServerCreator) MultiTransportLayer added in v1.2.4

func (ServerCreator) MultiTransportLayer() bool

true

func (ServerCreator) NewServer

func (ServerCreator) NewServer(dc *proxy.ListenConf) (proxy.Server, error)

func (ServerCreator) URLToListenConf added in v1.2.4

func (ServerCreator) URLToListenConf(u *url.URL, lc *proxy.ListenConf, format int) (*proxy.ListenConf, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL