jitsi / ice4j

A Java implementation of the ICE protocol
Apache License 2.0
437 stars 232 forks source link

How can I promote candidate UDP 80/443? #163

Open rasos opened 5 years ago

rasos commented 5 years ago

I am using the standard Jitsi Meet Set-up with nginx. As we are still facing numerous connectivity issues I am experimenting with tunnelling UDP traffic to the videobridge port 4443 directly. However, when ice4j is looking for candidate pairs, I can never see port 80 or 443 UDP. Is there a setting where I could "promote" this viable option?

nginx.conf

# redirect UDP packets directly to videobridge
stream {
# IPv4
  server {
    listen 443 udp;
    proxy_pass 127.0.0.1:4443;
  }
  server {
    listen 443;
    proxy_pass 127.0.0.1:444;
  }
  server {
    listen 80 udp;
    proxy_pass 127.0.0.1:4443;
  }
  server {
    listen 80;
    proxy_pass 127.0.0.1:81;
# IPv6
  }
  server {
    listen [::]:443 udp;
    proxy_pass ip6-localhost:4443;
  }
  server {
    listen [::]:443;
    proxy_pass ip6-localhost:444;
  }
  server {
    listen [::]:80 udp;
    proxy_pass ip6-localhost:4443;
  }
  server {
    listen [::]:80;
    proxy_pass ip6-localhost:81;
  }
}
bgrozev commented 5 years ago

You can use the TCP_HARVESTER_MAPPED_PORT to make the bridge advertise a port different than the one that it is bound to: https://github.com/jitsi/jitsi-videobridge/blob/master/doc/tcp.md#orgjitsivideobridgetcp_harvester_mapped_port