2021-05-01 12:45:37 +02:00
syntax = "proto3" ;
import "google/protobuf/descriptor.proto" ;
2021-07-21 20:23:11 +02:00
option go_package = "/proto" ;
2021-05-01 12:45:37 +02:00
package signalexchange ;
service SignalExchange {
// Synchronously connect to the Signal Exchange service offering connection candidates and waiting for connection candidates from the other party (remote peer)
2021-05-01 18:29:59 +02:00
rpc Send ( EncryptedMessage ) returns ( EncryptedMessage ) { }
2021-05-01 12:45:37 +02:00
// Connect to the Signal Exchange service offering connection candidates and maintain a channel for receiving candidates from the other party (remote peer)
2021-05-01 18:29:59 +02:00
rpc ConnectStream ( stream EncryptedMessage ) returns ( stream EncryptedMessage ) { }
2021-05-01 12:45:37 +02:00
}
2021-05-01 18:29:59 +02:00
// Used for sending through signal.
// The body of this message is the Body message encrypted with the Wireguard private key and the remote Peer key
message EncryptedMessage {
// Wireguard public key
string key = 2 ;
// Wireguard public key of the remote peer to connect to
string remoteKey = 3 ;
// encrypted message Body
bytes body = 4 ;
}
// A decrypted representation of the EncryptedMessage. Used locally before/after encryption
2021-05-01 12:45:37 +02:00
message Message {
2024-01-08 12:25:35 +01:00
// WireGuard public key
2021-05-01 18:29:59 +02:00
string key = 2 ;
2024-01-08 12:25:35 +01:00
// WireGuard public key of the remote peer to connect to
2021-05-01 18:29:59 +02:00
string remoteKey = 3 ;
Body body = 4 ;
}
2021-05-01 12:45:37 +02:00
2021-05-01 18:29:59 +02:00
// Actual body of the message that can contain credentials (type OFFER/ANSWER) or connection Candidate
// This part will be encrypted
message Body {
2021-05-01 12:45:37 +02:00
// Message type
enum Type {
OFFER = 0 ;
ANSWER = 1 ;
CANDIDATE = 2 ;
2023-03-16 16:46:17 +01:00
MODE = 4 ;
2021-05-01 12:45:37 +02:00
}
Type type = 1 ;
2021-05-01 18:29:59 +02:00
string payload = 2 ;
2022-09-02 19:33:35 +02:00
// wgListenPort is an actual WireGuard listen port
uint32 wgListenPort = 3 ;
string netBirdVersion = 4 ;
2023-03-16 16:46:17 +01:00
Mode mode = 5 ;
// featuresSupported list of supported features by the client of this protocol
repeated uint32 featuresSupported = 6 ;
2024-01-08 12:25:35 +01:00
// RosenpassConfig is a Rosenpass config of the remote peer our peer tries to connect to
RosenpassConfig rosenpassConfig = 7 ;
2024-06-14 14:40:31 +02:00
2024-07-03 15:03:57 +02:00
// relayServerAddress is url of the relay server
2024-06-14 14:40:31 +02:00
string relayServerAddress = 8 ;
2023-03-16 16:46:17 +01:00
}
// Mode indicates a connection mode
message Mode {
optional bool direct = 1 ;
2024-01-08 12:25:35 +01:00
}
message RosenpassConfig {
bytes rosenpassPubKey = 1 ;
// rosenpassServerAddr is an IP:port of the rosenpass service
string rosenpassServerAddr = 2 ;
2021-05-01 12:45:37 +02:00
}