basic

command
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 3 Imported by: 0

README

To Run

NOTE: This example requires the Go runtime to be installed on your machine.

cd to the the examples/basic directory and run the following in a terminal window:

$ go run main.go

Then, in another terminal window:

$ export https_proxy="http://127.0.0.1:8080/"
$ curl -v https://us-street.api.smartystreets.com/status # any secure URL

Now let's perform a direct connection to the server so we can observe that the TLS/SSL x509 certificate from the previous request and the following request are identical.

$ unset https_proxy
$ curl -v https://us-street.api.smartystreets.com/status

Production Use

$ go build -o cproxy
$ scp cproxy user@production-server.com:.

NOTE: While the above compiled binary is ready for deployment into production, this isn't the best strategy. The server has no filtering capabilities and is the equivalent of an "open relay". Without proper filtering, you've just opened up an anonymous proxy server that anyone can connect to and can connect to anything. It's a really bad idea. That's why cproxy is a library meant to be extended with custom Filter implementations to only allow trusted traffic through.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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