mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-15 03:11:02 +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
|
// 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
|
// doesn't block, discards the message if connection wasn't ready
|
||||||
func (h *Handshaker) OnRemoteOffer(offer OfferAnswer) bool {
|
func (h *Handshaker) OnRemoteOffer(offer OfferAnswer) bool {
|
||||||
|
// todo remove this if signaling can support relay
|
||||||
|
if ForcedRelayAddress() != "" {
|
||||||
|
offer.RelaySrvAddress = ForcedRelayAddress()
|
||||||
|
}
|
||||||
select {
|
select {
|
||||||
case h.remoteOffersCh <- offer:
|
case h.remoteOffersCh <- offer:
|
||||||
return true
|
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
|
// 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
|
// doesn't block, discards the message if connection wasn't ready
|
||||||
func (h *Handshaker) OnRemoteAnswer(answer OfferAnswer) bool {
|
func (h *Handshaker) OnRemoteAnswer(answer OfferAnswer) bool {
|
||||||
|
// todo remove this if signaling can support relay
|
||||||
|
if ForcedRelayAddress() != "" {
|
||||||
|
answer.RelaySrvAddress = ForcedRelayAddress()
|
||||||
|
}
|
||||||
select {
|
select {
|
||||||
case h.remoteAnswerCh <- answer:
|
case h.remoteAnswerCh <- answer:
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user