1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-13 15:00:58 +08:00

TUN-1673: Conflate Hello and Connect RPCs

This commit is contained in:
Chung-Ting Huang
2019-04-01 13:50:30 -05:00
parent 6804a5ff9d
commit 80d3d989eb
3 changed files with 157 additions and 648 deletions

View File

@@ -46,15 +46,6 @@ struct RegistrationOptions {
uuid @11 :Text;
}
struct HelloParameters {
# certificate and token to prove ownership of a zone
originCert @0 :Data;
# user defined labels for this cloudflared
tags @1 :List(Tag);
# number of previous attempts to send Hello
numPreviousAttempts @2 :UInt8;
}
struct CapnpConnectParameters {
# certificate and token to prove ownership of a zone
originCert @0 :Data;
@@ -62,12 +53,8 @@ struct CapnpConnectParameters {
cloudflaredID @1 :Data;
# number of previous attempts to send Connect
numPreviousAttempts @2 :UInt8;
}
struct CapnpServerHello {
connectResult @0 :ConnectResult;
# UUID assigned to this cloudflared
cloudflaredID @1 :Data;
# user defined labels for this cloudflared
tags @3 :List(Tag);
}
struct ConnectResult {
@@ -80,7 +67,7 @@ struct ConnectError {
cause @0 :Text;
# How long should this connection wait to retry in ns
retryAfter @1 :Int64;
shoudRetry @2 :Bool;
shouldRetry @2 :Bool;
}
struct Tag {
@@ -102,8 +89,5 @@ interface TunnelServer {
registerTunnel @0 (originCert :Data, hostname :Text, options :RegistrationOptions) -> (result :TunnelRegistration);
getServerInfo @1 () -> (result :ServerInfo);
unregisterTunnel @2 (gracePeriodNanoSec :Int64) -> ();
# originCert is used to verify ownership of a zone and hostnames it can serve
# tags are client-defined tags to associate with the cloudflared
hello @3(parameters :HelloParameters) -> (result: CapnpServerHello);
connect @4(parameters :CapnpConnectParameters) -> (result :ConnectResult);
connect @3 (parameters :CapnpConnectParameters) -> (result :ConnectResult);
}