easyproxy

package module
v0.0.0-...-0ccc314 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package easyproxy provides a method to quickly create a http.Transport or net.Conn using given proxy details (SOCKS5 or HTTP).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConn

func NewConn(c ProxyConfig, addr string, tlsConf *tls.Config) (*tls.Conn, error)

NewConn returns a tls.Conn to "addr" using the given proxy details. Leave user/pass blank if not needed.

func NewTransport

func NewTransport(c ProxyConfig) (*http.Transport, error)

NewTransport returns a http.Transport using the given proxy details. Leave user/pass blank if not needed.

Types

type Protocol

type Protocol int
const (
	SOCKS5 Protocol = iota // SOCKS5
	HTTP                   // HTTP
)

type ProxyConfig

type ProxyConfig struct {
	Protocol Protocol
	Addr     string
	User     string
	Password string
}

Jump to

Keyboard shortcuts

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