example-proxy

command module
v0.0.0-...-769e7fa Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

README

Example of using TLSClientFactory

This example shows how you can use Transport.TLSClientFactory to force this library to use refraction-networking/utls for proxied conns.

  • main.go sets up an oohttp.Transport instance, uses the Proxy field to configure a SOCKS5 proxy, and the TLSClientFactory to use uTLS when needed;

  • utls.go contains the code to create an uTLS conn.

You should not change the Transport.TLSClientFactory while the transport is being used. Doing that is likely to cause data races.

An alternative strategy could be to set the global oohttp.TLSClientFactory field, which will cause all connections to use such a factory. If you choose to override the global factory (as opposed to the per-Transport one), you should do this only once before calling any HTTP code. Changing the global factory while HTTP code is running causes data races.

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