Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC candidate hostname gets resolved by server instead of client #146

Closed
kantlivelong opened this issue Jan 4, 2023 · 3 comments
Closed
Labels
question Further information is requested

Comments

@kantlivelong
Copy link

When specifying a hostname as a WebRTC candidate it appears that go2rtc resolves the hostname to an IP and passes the IP to the client instead of passing the hostname and letting the client handle the resolution. This can be problematic with environments using split DNS.

Example config:

---
webrtc:
  listen: ":8555"
  candidates:
    - host.domain.com:8555

Internally the machine running go2rtc uses DNS 192.168.1.1.

Example internal DNS result:

$ dig host.domain.com @192.168.1.1

; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> host.domain.com @192.168.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34579
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;host.domain.com. IN	A

;; ANSWER SECTION:
host.domain.com. 3600 IN A	192.168.1.10

;; Query time: 0 msec
;; SERVER: 192.168.1.1#53(192.168.1.1) (UDP)
;; WHEN: Wed Jan 04 14:37:30 EST 2023
;; MSG SIZE  rcvd: 80

Example external DNS result:

$ dig host.domain.com @8.8.8.8              

; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> host.domain.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24206
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;host.domain.com.		IN	A

;; ANSWER SECTION:
host.domain.com.	60	IN	A	123.123.123.123

;; Query time: 55 msec
;; SERVER: 8.8.8.8#53(8.8.8.8) (UDP)
;; WHEN: Wed Jan 04 14:41:02 EST 2023
;; MSG SIZE  rcvd: 66

go2rtc version: v0.1-rc.6

@AlexxIT AlexxIT added the question Further information is requested label Jan 4, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 4, 2023

You can try to ask pion team, why they support only IP as candidate. Theoretically it can be hostname, but library will fail on that step:

cand, err := ice.NewCandidateHost(&ice.CandidateHostConfig{
Network: "tcp",
Address: host,
Port: i,
Component: ice.ComponentRTP,
TCPType: ice.TCPTypePassive,
})

@kantlivelong
Copy link
Author

kantlivelong commented Jan 4, 2023

Ah ha! I had a feeling that would be the case somewhere. I'll open an issue up there. Thanks!

Until then maybe it's worth mentioning in the docs that lookup is done by the server and not client?

@kantlivelong kantlivelong changed the title WebRTC canidate hostname gets resolved by server instead of client WebRTC candidate hostname gets resolved by server instead of client Jan 4, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented May 28, 2024

Please let me know if the problem is relevant

@AlexxIT AlexxIT closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants