mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
30 lines
589 B
Go
30 lines
589 B
Go
package main
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
// Interface for collecting and releasing snowflakes.
|
|
type SnowflakeCollector interface {
|
|
Collect() (*webRTCConn, error)
|
|
Release() *webRTCConn
|
|
}
|
|
|
|
// Interface for catching those wild Snowflakes.
|
|
type Tongue interface {
|
|
Catch() (*webRTCConn, error)
|
|
}
|
|
|
|
// Interface which primarily adapts to goptlib's SocksConn struct.
|
|
type SocksConnector interface {
|
|
Grant(*net.TCPAddr) error
|
|
Reject() error
|
|
net.Conn
|
|
}
|
|
|
|
// Interface for the Snowflake's transport.
|
|
// (Specifically, webrtc.DataChannel)
|
|
type SnowflakeChannel interface {
|
|
Send([]byte)
|
|
Close() error
|
|
}
|