Skip to content

golang styles proxy client, support http/https, socks4/5, ssh

License

Notifications You must be signed in to change notification settings

chainreactors/proxyclient

Repository files navigation

ProxyClient

the proxy client library

refactor from github.com/RouterScript/ProxyClient

supported SOCKS4, SOCKS4A, SOCKS5, HTTP, HTTPS etc proxy protocols

Supported Schemes

  • Direct
  • Reject
  • Blackhole
  • HTTP (fixed)
  • HTTPS (fixed)
  • SOCKS5 (fixed)
  • ShadowSocks (fixed)
  • SSH Agent (fixed)
  • suo5
  • neoreg

Documentation

Example

package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"github.com/chainreactors/proxyclient"
)

func main() {
	proxy, _ := url.Parse("http://localhost:8080")
	dial, _ := proxyclient.NewClient(proxy)
	client := &http.Client{
		Transport: &http.Transport{
			DialContext: dial.Context,
		},
	}
	request, err := client.Get("http://www.example.com")
	if err != nil {
		panic(err)
	}
	content, err := ioutil.ReadAll(request.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(content))
}

Reference

About

golang styles proxy client, support http/https, socks4/5, ssh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages