mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
pull copyLoop out of goroutine, better pop and reset
This commit is contained in:
parent
a71c98c0ae
commit
2bf0e5457e
5 changed files with 70 additions and 35 deletions
|
@ -17,10 +17,9 @@ type Resetter interface {
|
|||
// Interface for a single remote WebRTC peer.
|
||||
// In the Client context, "Snowflake" refers to the remote browser proxy.
|
||||
type Snowflake interface {
|
||||
io.ReadWriter
|
||||
io.ReadWriteCloser
|
||||
Resetter
|
||||
Connector
|
||||
Close() error
|
||||
}
|
||||
|
||||
// Interface for catching Snowflakes. (aka the remote dialer)
|
||||
|
@ -34,7 +33,7 @@ type SnowflakeCollector interface {
|
|||
|
||||
// Add a Snowflake to the collection.
|
||||
// Implementation should decide how to connect and maintain the webRTCConn.
|
||||
Collect() error
|
||||
Collect() (Snowflake, error)
|
||||
|
||||
// Remove and return the most available Snowflake from the collection.
|
||||
Pop() Snowflake
|
||||
|
@ -52,6 +51,6 @@ type SocksConnector interface {
|
|||
|
||||
// Interface for the Snowflake's transport. (Typically just webrtc.DataChannel)
|
||||
type SnowflakeDataChannel interface {
|
||||
io.Closer
|
||||
Send([]byte)
|
||||
Close() error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue