Documentation
¶
Index ¶
- Constants
- Variables
- func ApiHandlerPing(ctx context.Context, h i.Outbound, url string) (int, error)
- func ApiHandlerUsable1(ctx context.Context, h i.Outbound, url string) (bool, error)
- func Curve25519Genkey(StdEncoding bool, input_base64 string) (string, string, error)
- func DownloadToFile(url string, client *http.Client, dest string) error
- func DownloadToMemory(url string, handlers []i.Handler) ([]byte, error)
- func DownloadToMemoryResty(ctx context.Context, url string, handlers ...i.Outbound) ([]byte, error)
- func ExecuteECH(serverName string) ([]byte, []byte, error)
- func GenerateECHKeySet(configID uint8, domain string, kem uint16) (reality.EchConfig, []byte, error)
- func GetMyIPv4() (string, error)
- func HandlerToHttpClient(h i.FlowHandler) *http.Client
- func InboundConfigToOutboundConfig(namePrefix string, inboundConfig *configs.ProxyInboundConfig, ...) ([]*configs.OutboundHandlerConfig, error)
- func MarshalBinary(ech reality.EchConfig) ([]byte, error)
- func MultiInboundConfigToOutboundConfig(namePrefix string, inboundConfig *configs.MultiProxyInboundConfig, ...) ([]*configs.OutboundHandlerConfig, error)
- func NICHasGlobalIPv6Address(index uint32) (bool, error)
- func NICSupportIPv6Index(index uint32) bool
- func NICSupportIPv6Name(nicName string) bool
- func ParseKeyValueText(text string) map[string]string
- func Ping(ctx context.Context, config *configs.OutboundHandlerConfig, ...) (uint32, error)
- func RttTest(ctx context.Context, ap net.AddressPort, dl i.Dialer, pl i.PacketListener, ...) (int, error)
- func Speedtest(ctx context.Context, url string, h i.Outbound) int64
- func TestIpv6(ctx context.Context, h i.Outbound, address string) (bool, error)
- type FlowHandlerToDialer
- type HandlerToDialerListener
- type HandlerToProxyClient
- func (h *HandlerToProxyClient) Dial(ctx context.Context, dst net.Destination) (net.Conn, error)
- func (h *HandlerToProxyClient) DialWithInitialData(ctx context.Context, dst net.Destination, initialData []byte) (net.Conn, error)
- func (h *HandlerToProxyClient) ListenPacket(ctx context.Context, dst net.Destination) (udp.UdpConn, error)
- type IPv6SupportChangeNotifier
- type OnIPv6SupportChangedFunc
- type PacketHandlerToListener
- type PacketRwToPacketConn
Constants ¶
View Source
const ( GoogleDNS6 = "2001:4860:4860::8888" AliDNS6 = "2400:3200::1" )
View Source
const ( SpeedtestURL1 = "https://speed.cloudflare.com/__down?bytes=1000000" //1MB SpeedtestURL10 = "https://speed.cloudflare.com/__down?bytes=10000000" //10MB )
View Source
const ExtensionEncryptedClientHello = 0xfe0d
View Source
const KDF_HKDF_SHA384 = 0x0002
View Source
const KDF_HKDF_SHA512 = 0x0003
Variables ¶
View Source
var TraceList = []string{
"https://blog.cloudflare.com/cdn-cgi/trace",
"https://developers.cloudflare.com/cdn-cgi/trace",
"https://hostinger.com/cdn-cgi/trace",
"https://ahrefs.com/cdn-cgi/trace",
}
View Source
var (
UsableTestUrls = []string{
"https://www.google.com/generate_204",
"https://www.gstatic.com/generate_204",
"https://www.apple.com/library/test/success.html",
"http://www.msftconnecttest.com/connecttest.txt",
"http://jsonplaceholder.typicode.com/posts/1",
}
)
Functions ¶
func ApiHandlerPing ¶
func ApiHandlerUsable1 ¶
func Curve25519Genkey ¶
func DownloadToMemoryResty ¶
func GenerateECHKeySet ¶
func HandlerToHttpClient ¶
func HandlerToHttpClient(h i.FlowHandler) *http.Client
func InboundConfigToOutboundConfig ¶
func InboundConfigToOutboundConfig(namePrefix string, inboundConfig *configs.ProxyInboundConfig, serverAddress string) ([]*configs.OutboundHandlerConfig, error)
func MarshalBinary ¶
reference github.com/OmarTariq612/goech
func MultiInboundConfigToOutboundConfig ¶
func MultiInboundConfigToOutboundConfig(namePrefix string, inboundConfig *configs.MultiProxyInboundConfig, serverAddress string) ([]*configs.OutboundHandlerConfig, error)
unencrypted options will not be included in the final results. For example, unencrypted proxy protocols without security will not be included
func NICHasGlobalIPv6Address ¶
func NICSupportIPv6Index ¶
func NICSupportIPv6Name ¶
func ParseKeyValueText ¶
func Ping ¶
func Ping(ctx context.Context, config *configs.OutboundHandlerConfig, info i.DefaultInterfaceInfo) (uint32, error)
func RttTest ¶
func RttTest(ctx context.Context, ap net.AddressPort, dl i.Dialer, pl i.PacketListener, ipResolver i.IPResolver) (int, error)
Types ¶
type FlowHandlerToDialer ¶
type FlowHandlerToDialer struct {
i.FlowHandler
}
Adapt FlowHandler to Dialer
func (*FlowHandlerToDialer) Dial ¶
func (h *FlowHandlerToDialer) Dial(ctx context.Context, dest net.Destination) (net.Conn, error)
type HandlerToDialerListener ¶
type HandlerToDialerListener struct {
PacketHandlerToListener
FlowHandlerToDialer
}
type HandlerToProxyClient ¶
func (*HandlerToProxyClient) Dial ¶
func (h *HandlerToProxyClient) Dial(ctx context.Context, dst net.Destination) (net.Conn, error)
func (*HandlerToProxyClient) DialWithInitialData ¶
func (h *HandlerToProxyClient) DialWithInitialData(ctx context.Context, dst net.Destination, initialData []byte) (net.Conn, error)
func (*HandlerToProxyClient) ListenPacket ¶
func (h *HandlerToProxyClient) ListenPacket(ctx context.Context, dst net.Destination) (udp.UdpConn, error)
type IPv6SupportChangeNotifier ¶
type IPv6SupportChangeNotifier struct {
// contains filtered or unexported fields
}
func (*IPv6SupportChangeNotifier) Notify ¶
func (n *IPv6SupportChangeNotifier) Notify()
func (*IPv6SupportChangeNotifier) Register ¶
func (n *IPv6SupportChangeNotifier) Register(observer i.IPv6SupportChangeObserver)
func (*IPv6SupportChangeNotifier) Unregister ¶
func (n *IPv6SupportChangeNotifier) Unregister(observer i.IPv6SupportChangeObserver)
type OnIPv6SupportChangedFunc ¶
type OnIPv6SupportChangedFunc func()
func (OnIPv6SupportChangedFunc) OnIPv6SupportChanged ¶
func (f OnIPv6SupportChangedFunc) OnIPv6SupportChanged()
type PacketHandlerToListener ¶
type PacketHandlerToListener struct {
i.PacketHandler
Target *net.Destination
}
func (*PacketHandlerToListener) ListenPacket ¶
func (h *PacketHandlerToListener) ListenPacket(ctx context.Context, network, address string) (net.PacketConn, error)
type PacketRwToPacketConn ¶
type PacketRwToPacketConn struct {
udp.UdpConn
udp.PacketReaderToReadFromer
udp.PacketWriterToWriteToer
// contains filtered or unexported fields
}
func (*PacketRwToPacketConn) LocalAddr ¶
func (p *PacketRwToPacketConn) LocalAddr() net.Addr
func (*PacketRwToPacketConn) SetDeadline ¶
func (l *PacketRwToPacketConn) SetDeadline(t time.Time) error
func (*PacketRwToPacketConn) SetReadDeadline ¶
func (l *PacketRwToPacketConn) SetReadDeadline(t time.Time) error
func (*PacketRwToPacketConn) SetWriteDeadline ¶
func (l *PacketRwToPacketConn) SetWriteDeadline(t time.Time) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.