Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Dec 13, 2023
1 parent 38b12cb commit e39e6ef
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 345 deletions.
4 changes: 0 additions & 4 deletions internal/feature/oohttpfeat/doc.go

This file was deleted.

110 changes: 0 additions & 110 deletions internal/feature/oohttpfeat/oohttp_enabled.go

This file was deleted.

104 changes: 0 additions & 104 deletions internal/feature/oohttpfeat/oohttp_otherwise.go

This file was deleted.

6 changes: 0 additions & 6 deletions internal/feature/ootlsfeat/doc.go

This file was deleted.

16 changes: 0 additions & 16 deletions internal/feature/ootlsfeat/ootls_enabled.go

This file was deleted.

15 changes: 0 additions & 15 deletions internal/feature/ootlsfeat/ootls_otherwise.go

This file was deleted.

30 changes: 9 additions & 21 deletions internal/model/netx.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"syscall"
"time"

oohttp "github.com/ooni/oohttp"
"github.com/quic-go/quic-go"
utls "gitlab.com/yawning/utls.git"
)
Expand Down Expand Up @@ -308,25 +309,12 @@ type Resolver interface {
LookupNS(ctx context.Context, domain string) ([]*net.NS, error)
}

// TLSConn is the interface representing a *tls.Conn compatible
// connection, which could possibly be different from a *tls.Conn
// as long as it implements the interface. You can use, for
// example, refraction-networking/utls instead of the stdlib.
type TLSConn interface {
// net.Conn is the underlying interface
net.Conn

// ConnectionState returns the ConnectionState according
// to the standard library.
ConnectionState() tls.ConnectionState

// HandshakeContext performs an TLS handshake bounded
// in time by the given context.
HandshakeContext(ctx context.Context) error

// NetConn returns the underlying net.Conn
NetConn() net.Conn
}
// TLSConn is the type of connection that oohttp expects from
// any library that implements TLS functionality. By using this
// kind of TLSConn we're able to use both the standard library
// and gitlab.com/yawning/utls.git to perform TLS operations. Note
// that the stdlib's tls.Conn implements this interface.
type TLSConn = oohttp.TLSConn

// Ensures that a [*tls.Conn] implements the [TLSConn] interface.
var _ TLSConn = &tls.Conn{}
Expand All @@ -337,7 +325,7 @@ type TLSDialer interface {
CloseIdleConnections()

// DialTLSContext dials a TLS connection. This method will always return
// to you a TLSConn, so you can always safely cast to it.
// to you a oohttp.TLSConn, so you can always safely cast to it.
//
// The endpoint is an endpoint like the ones accepted by [net.DialContext]. For example,
// x.org:443, 130.192.91.211:443 and [::1]:443. Note that IPv6 addrs are quoted.
Expand Down Expand Up @@ -369,7 +357,7 @@ type TLSHandshaker interface {

// Trace allows to collect measurement traces. A trace is injected into
// netx operations using context.WithValue. Netx code retrieves the trace
// using context.Value. See the docs/design/dd-003-step-by-step.md for the
// using context.Value. See docs/design/dd-003-step-by-step.md for the
// design document explaining why we implemented context-based tracing.
type Trace interface {
// TimeNow returns the current time. Normally, this should be the same
Expand Down
Loading

0 comments on commit e39e6ef

Please sign in to comment.