mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Make easier to extend the list of known proxy types
And include iptproxy as a valid proxy type.
This commit is contained in:
parent
bd636a1374
commit
b265bd3092
4 changed files with 57 additions and 64 deletions
|
@ -12,14 +12,17 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
version = "1.2"
|
||||
|
||||
ProxyStandalone = "standalone"
|
||||
ProxyWebext = "webext"
|
||||
ProxyBadge = "badge"
|
||||
ProxyUnknown = "unknown"
|
||||
version = "1.2"
|
||||
ProxyUnknown = "unknown"
|
||||
)
|
||||
|
||||
var KnownProxyTypes = map[string]bool{
|
||||
"standalone": true,
|
||||
"webext": true,
|
||||
"badge": true,
|
||||
"iptproxy": true,
|
||||
}
|
||||
|
||||
/* Version 1.2 specification:
|
||||
|
||||
== ProxyPollRequest ==
|
||||
|
@ -138,11 +141,7 @@ func DecodeProxyPollRequest(data []byte) (sid string, proxyType string, natType
|
|||
|
||||
// we don't reject polls with an unknown proxy type because we encourage
|
||||
// projects that embed proxy code to include their own type
|
||||
switch message.Type {
|
||||
case ProxyStandalone:
|
||||
case ProxyWebext:
|
||||
case ProxyBadge:
|
||||
default:
|
||||
if !KnownProxyTypes[message.Type] {
|
||||
message.Type = ProxyUnknown
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue