mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-14 19:00:50 +01:00
Moc signal message support
This commit is contained in:
parent
4f890ff712
commit
c7db2c0524
@ -117,6 +117,10 @@ func (h *Handshaker) Handshake(args HandshakeArgs) (*OfferAnswer, error) {
|
||||
// OnRemoteOffer handles an offer from the remote peer and returns true if the message was accepted, false otherwise
|
||||
// doesn't block, discards the message if connection wasn't ready
|
||||
func (h *Handshaker) OnRemoteOffer(offer OfferAnswer) bool {
|
||||
// todo remove this if signaling can support relay
|
||||
if ForcedRelayAddress() != "" {
|
||||
offer.RelaySrvAddress = ForcedRelayAddress()
|
||||
}
|
||||
select {
|
||||
case h.remoteOffersCh <- offer:
|
||||
return true
|
||||
@ -130,6 +134,10 @@ func (h *Handshaker) OnRemoteOffer(offer OfferAnswer) bool {
|
||||
// OnRemoteAnswer handles an offer from the remote peer and returns true if the message was accepted, false otherwise
|
||||
// doesn't block, discards the message if connection wasn't ready
|
||||
func (h *Handshaker) OnRemoteAnswer(answer OfferAnswer) bool {
|
||||
// todo remove this if signaling can support relay
|
||||
if ForcedRelayAddress() != "" {
|
||||
answer.RelaySrvAddress = ForcedRelayAddress()
|
||||
}
|
||||
select {
|
||||
case h.remoteAnswerCh <- answer:
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user