Verified Commit e5b799d6 authored by shelikhoo's avatar shelikhoo
Browse files

Update documents for broker messages

parent 0ae4d821
......@@ -24,15 +24,16 @@ var KnownProxyTypes = map[string]bool{
"iptproxy": true,
}
/* Version 1.2 specification:
/* Version 1.3 specification:
== ProxyPollRequest ==
{
Sid: [generated session id of proxy],
Version: 1.2,
Version: 1.3,
Type: ["badge"|"webext"|"standalone"],
NAT: ["unknown"|"restricted"|"unrestricted"],
Clients: [number of current clients, rounded down to multiples of 8]
Clients: [number of current clients, rounded down to multiples of 8],
AcceptedRelayPattern: [a pattern representing accepted set of relay domains]
}
== ProxyPollResponse ==
......@@ -44,7 +45,8 @@ HTTP 200 OK
type: offer,
sdp: [WebRTC SDP]
},
NAT: ["unknown"|"restricted"|"unrestricted"]
NAT: ["unknown"|"restricted"|"unrestricted"],
RelayURL: [the WebSocket URL proxy should connect to relay Snowflake traffic]
}
2) If a client is not matched:
......@@ -60,7 +62,7 @@ HTTP 400 BadRequest
== ProxyAnswerRequest ==
{
Sid: [generated session id of proxy],
Version: 1.2,
Version: 1.3,
Answer:
{
type: answer,
......
......@@ -100,6 +100,24 @@ Metrics data from the Snowflake broker can be retrieved by sending an HTTP GET r
A count of the total number of unique IP addresses of snowflake
proxies that have an unknown NAT type.
"snowflake-proxy-poll-with-relay-url-count" NUM NL
[At most once.]
A count of snowflake proxy polls with relay url extension present.
This means this proxy understands relay url, and is sending its
allowed prefix.
"snowflake-proxy-poll-without-relay-url-count" NUM NL
[At most once.]
A count of snowflake proxy polls with relay url extension absent.
This means this proxy is not yet updated.
"snowflake-proxy-rejected-for-relay-url-count" NUM NL
[At most once.]
A count of snowflake proxy polls with relay url extension rejected
based on broker's relay url extension policy.
This means an incompatible allowed relay pattern is included in the
proxy poll message.
2. Broker messaging specification and endpoints
The broker facilitates the connection of snowflake clients and snowflake proxies
......@@ -177,10 +195,11 @@ POST /proxy HTTP
{
Sid: [generated session id of proxy],
Version: 1.1,
Version: 1.3,
Type: ["badge"|"webext"|"standalone"|"mobile"],
NAT: ["unknown"|"restricted"|"unrestricted"],
Clients: [number of current clients, rounded down to multiples of 8]
Clients: [number of current clients, rounded down to multiples of 8],
AcceptedRelayPattern: [a pattern representing accepted set of relay domains]
}
```
......@@ -195,7 +214,8 @@ HTTP 200 OK
{
type: offer,
sdp: [WebRTC SDP]
}
},
RelayURL: [the WebSocket URL proxy should connect to relay Snowflake traffic]
}
```
......@@ -220,7 +240,7 @@ POST /answer HTTP
{
Sid: [generated session id of proxy],
Version: 1.1,
Version: 1.3,
Answer:
{
type: answer,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment