Comments (5)
If you have multiple interfaces to listen on, don't use a single external address to call SetNAT1To1IPs, which override your candidates. And it will cause another port conflict issue like this:
You have interface IA, IB, both mapping to IC. Two clients 1 and 2.
client 1 get server candidates IC:34567(from IA), IC:45678(from IB)
client 2 get server candidates IC:34567(from IB), IC:45678(from IA), because when pion allocateing port for client2, IA:45678 and IB:34567 are free to use, but when they mapped to IC, will conflict with client1's address and failed to connect.
The better way is (what we are doing now):
- enumerate the interfaces you are going to use. (IA, IB, IC)
- resolve external address for each interface (by public stun server) (IA -> EA, IB ->EB, IC -> EA)
- SetNAT1To1IPs with mapping pair instead of a single external address, and if you have two interface resolved to same public address, only map the first one and keep the other one map to itself. SetNAT1To1IPs([]string{EA/IA, EB/IB, IC/IC})
from ice.
Very interesting, I wasn't aware SetNAT1To1IPs
supported more advanced parameters like pairs but now it makes all sense. I'll definitely give this a try, thank you!
from ice.
@cnderrauber That "trick" seems to work nicely. Out of curiosity, would it be acceptable to map the first interface (e.g. IA) as EA/IA and any subsequent interface to itself (IB/IB, IC/IC, and so on)? I am thinking of a scenario where resolving the external address is not possible (e.g. blocked outgoing ports) and the user will explicitly provide a single public IP instead.
from ice.
@streamer45 It will definitely work if your IA can be accessed from EA by public clients.
from ice.
Very well, this was extremely helpful, thank you again. We can close this one :)
from ice.
Related Issues (20)
- Simplify Agent.updateConnectionState() HOT 1
- Reenable IPv6 UDPMux tests in i386
- Active TCP candidates? HOT 7
- Support server reflexive TCP candidate type HOT 13
- Fix type of CandidatePairState enum
- TestAgentActiveTCP test is failing due to data race
- Active TCP performs network operations in main thread HOT 7
- Connection failing to TCP candidate when listening on multiple interfaces using `MultiTCPMux` and `NAT1To1IPs` HOT 5
- Noisy warnings if TURN/STUN host is not reachable via IPv6
- Panic when adding candidate HOT 5
- bug(log): webrtc using ice will print wrong log HOT 1
- ice v2 depends on transport v2.2.2, which had a breaking change HOT 1
- Candidate type is not changed from peer-reflexive to host HOT 1
- Allow users to pass custom 'CandidateSelectorControlling` and `CandidateSelectorControlled` HOT 3
- ConnectionState changes may be reported incorrectly HOT 4
- Please add a new release tag HOT 2
- Android 11 ListenUDP permission denine
- Support ipv6 for mDNS Server HOT 2
- Start the listening port by default above 1024 HOT 1
- Doubts about discarding monotonic time HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ice.