httpRelay

package module
v0.0.0-...-f08efaa Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: MIT Imports: 11 Imported by: 0

README

HTTP proxy to SOCKS 5 proxy relay

Single-purpose HTTP proxy relaying requests to an existing (external) SOCKS 5 proxy server. This tool is useful in the case where the SOCKS proxy is the only proxy available, but the application that you wish to use does not support SOCKS. This little program is a welcome addition to SSH's capability of setting up a SOCKS proxy server.

Please note: This implementation is specifically limited to this use case only. Other use cases may be trivial to create, however they are not part of this implementation.

Usage:

./relay -listen :8080 -socks localhost:8000

Start a HTTP relay proxy that listens on port 8080 of every interface and connects to a SOCKS proxy server on localhost port 8000 for relaying your requests.

Note

Please make sure to use at least Go 1.4.3 or Go 1.5 when compiling this application. These versions of Go have some security-related fixes for the net/http package.

References

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlockedHost = errors.New("host is blocked")
View Source
var ErrNonHijackableWriter = errors.New("failed to acquire raw client connection: writer is not hijackable")

ErrNonHijackableWriter is an error that is returned when the connection cannot be hijacked.

Functions

func Fuzz

func Fuzz(data []byte) int

Fuzz is go-fuzz's fuzzing function. Though there is not much to fuzz.

Types

type HTTPProxyHandler

type HTTPProxyHandler struct {
	// Dialer is the dialer for connecting to the SOCKS5 proxy.
	Dialer    proxy.Dialer
	UserAgent string
}

HTTPProxyHandler is a proxy handler that passes on request to a SOCKS5 proxy server.

func (*HTTPProxyHandler) ServeHTTP

func (h *HTTPProxyHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)

type NopDialer

type NopDialer struct{}

func (NopDialer) Dial

func (NopDialer) Dial(network, addr string) (net.Conn, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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