mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add Relay Info Forwarding for Snowflake
This commit is contained in:
parent
d5a87c3c02
commit
5d7a3766d6
2 changed files with 26 additions and 1 deletions
|
@ -36,6 +36,13 @@ type BrokerContext struct {
|
|||
snowflakeLock sync.Mutex
|
||||
proxyPolls chan *ProxyPoll
|
||||
metrics *Metrics
|
||||
|
||||
bridgeList BridgeListHolderFileBased
|
||||
allowedRelayPattern string
|
||||
}
|
||||
|
||||
func (ctx *BrokerContext) GetBridgeInfo(fingerprint [20]byte) (BridgeInfo, error) {
|
||||
return ctx.bridgeList.GetBridgeInfo(fingerprint)
|
||||
}
|
||||
|
||||
func NewBrokerContext(metricsLogger *log.Logger) *BrokerContext {
|
||||
|
@ -139,6 +146,14 @@ func (ctx *BrokerContext) AddSnowflake(id string, proxyType string, natType stri
|
|||
return snowflake
|
||||
}
|
||||
|
||||
func (ctx *BrokerContext) InstallBridgeListProfile(reader io.Reader, relayPattern string) error {
|
||||
if err := ctx.bridgeList.LoadBridgeInfo(reader); err != nil {
|
||||
return err
|
||||
}
|
||||
ctx.allowedRelayPattern = relayPattern
|
||||
return nil
|
||||
}
|
||||
|
||||
// Client offer contains an SDP, bridge fingerprint and the NAT type of the client
|
||||
type ClientOffer struct {
|
||||
natType string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue