Skip to content

Commit

Permalink
doc: make sure we provide accurate information
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Jan 5, 2023
1 parent 854a2b3 commit 1913924
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions example/example-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 0 additions & 8 deletions example/example-utls-with-dial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
8 changes: 2 additions & 6 deletions example/example-utls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

0 comments on commit 1913924

Please sign in to comment.