diff --git a/README.md b/README.md index 18348d83..963b0737 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ func (txp *StdlibTransport) RoundTrip(stdReq *http.Request) (*http.Response, err } ``` -See [example/example-utls/http.go](example/example-utls/http.go) for a real +See [example/internal/utlsx/utlsx.go](example/internal/utlsx/utlsx.go) for a real world example where we use `StdlibTransport` to be `net/http` compatible. ### Interface between this library and any TLS library @@ -155,7 +155,7 @@ func (c *uconn) HandshakeContext(ctx context.Context) error { } ``` -See [example/example-utls/tls.go](example/example-utls/tls.go) for a real-world +See [example/internal/utlsx/utlsx.go](example/internal/utlsx/utlsx.go) for a real-world example of writing a `TLSConn` compatible adapter. Once you have the adapter in place, you should write a factory for creating @@ -261,7 +261,7 @@ the `Request` and `Response` fields; - [ ] create a new working branch to update the examples; -- [ ] ensure [example/example-utls/tls.go](example/example-utls/tls.go) +- [ ] ensure [example/internal/utlsx/utlsx.go](example/internal/utlsx/utlsx.go) copies all the `ConnectionState` fields; - [ ] go to [example](example), update *each submodule* and ensure diff --git a/example/example-proxy/README.md b/example/example-proxy/README.md index e5088b80..ec420a3c 100644 --- a/example/example-proxy/README.md +++ b/example/example-proxy/README.md @@ -6,8 +6,6 @@ library to use `refraction-networking/utls` for proxied conns. * [main.go](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](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. diff --git a/example/example-utls-with-dial/README.md b/example/example-utls-with-dial/README.md index d14be881..5a92a676 100644 --- a/example/example-utls-with-dial/README.md +++ b/example/example-utls-with-dial/README.md @@ -3,13 +3,5 @@ This example shows how you can use this library to combine `net/http` and `refraction-networking/utls` into the same product. -* [http.go](http.go) shows how to interface this library with `net/http` so -the rest of your codebase uses `net/http`; - -* [tls.go](tls.go) shows how to wrap `utls.UConn` to be compatible with -the `TLSConn` interface defined by this library; - -* [main.go](main.go) is the rest of the codebase using `net/http`. - The strategy we're using here is to override `DialTLSContext` to force using our own TLS dialer that uses uTLS (this is what OONI does). diff --git a/example/example-utls/README.md b/example/example-utls/README.md index 5d2aaa85..24849a0c 100644 --- a/example/example-utls/README.md +++ b/example/example-utls/README.md @@ -3,10 +3,6 @@ This example shows how you can use this library to combine `net/http` and `refraction-networking/utls` into the same product. -* [http.go](http.go) shows how to interface this library with `net/http` so -the rest of your codebase uses `net/http`; +The strategy we're using here is to override `TLSClientFactory` to wrap +newly created TCP connections using UTLS. -* [tls.go](tls.go) shows how to wrap `utls.UConn` to be compatible with -the `TLSConn` interface defined by this library; - -* [main.go](main.go) is the rest of the codebase using `net/http`.