Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,7 @@ func (ep *endpoint) runRelay(ctx context.Context, conn *quic.Conn) error {
return fmt.Errorf("relay unexpected response")
}

var relays []*pbclient.DirectRelay
relays = append(relays, iterc.MapSlice(resp.Relay.Relays, func(relay *pbclient.Relay) *pbclient.DirectRelay {
return &pbclient.DirectRelay{
Id: relay.Id,
Addresses: relay.Addresses,
ServerCertificate: relay.ServerCertificate,
}
})...)
relays = append(relays, resp.Relay.Directs...)

ep.peer.setRelays(relays)
ep.peer.setRelays(resp.Relay.Directs)
}
})

Expand Down
6 changes: 2 additions & 4 deletions model/protos.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (v ConnectRelayNextProto) String() string {

func GetConnectRelayNextProto(conn *quic.Conn) ConnectRelayNextProto {
proto := conn.ConnectionState().TLS.NegotiatedProtocol
for _, v := range []ConnectRelayNextProto{ConnectRelayV02, ConnectRelayV01} {
for _, v := range []ConnectRelayNextProto{ConnectRelayV02} {
if v.string == proto {
return v
}
Expand All @@ -58,7 +58,6 @@ func GetConnectRelayNextProto(conn *quic.Conn) ConnectRelayNextProto {

var (
ConnectRelayUnknown = ConnectRelayNextProto{}
ConnectRelayV01 = ConnectRelayNextProto{"connet-peer-relay/0.1"} // 0.7.0
ConnectRelayV02 = ConnectRelayNextProto{"connet-peer-relay/0.2"} // 0.13.0
)

Expand All @@ -71,7 +70,7 @@ func (v RelayControlNextProto) String() string {

func GetRelayControlNextProto(conn *quic.Conn) RelayControlNextProto {
proto := conn.ConnectionState().TLS.NegotiatedProtocol
for _, v := range []RelayControlNextProto{RelayControlV03, RelayControlV02} {
for _, v := range []RelayControlNextProto{RelayControlV03} {
if v.string == proto {
return v
}
Expand All @@ -81,7 +80,6 @@ func GetRelayControlNextProto(conn *quic.Conn) RelayControlNextProto {

var (
RelayControlUnknown = RelayControlNextProto{}
RelayControlV02 = RelayControlNextProto{"connet-relay/0.2"} // 0.8.0
RelayControlV03 = RelayControlNextProto{"connet-relay/0.3"} // 0.13.0
// Update GetRelayControlNextProto when adding a new one
)
7 changes: 0 additions & 7 deletions proto/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ message Response {
repeated RemotePeer peers = 1;
}
message Relays {
repeated Relay relays = 1;
repeated DirectRelay directs = 2;
}
}
Expand All @@ -66,12 +65,6 @@ message RemotePeer {
Peer peer = 8;
}

message Relay {
string id = 3;
repeated model.HostPort addresses = 4;
bytes server_certificate = 2; // endpoint specific certificate to be used by the client
}

message DirectRelay {
string id = 1; // relay id as assigned by the control server
repeated model.HostPort addresses = 2;
Expand Down
172 changes: 48 additions & 124 deletions proto/pbclient/client.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading