Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

gst-rust can't connect to WebSocket #120

Closed
zizhengtai opened this issue Jul 15, 2019 · 6 comments
Closed

gst-rust can't connect to WebSocket #120

zizhengtai opened this issue Jul 15, 2019 · 6 comments

Comments

@zizhengtai
Copy link

I'm on macOS 10.14.5 and have installed all the GStreamer plugins via Homebrew. I cloned this repo, went into the sendrecv/gst-rust directory and compiled it successfully with cargo build. However, when I tried to do cargo run -- --peer-id=x where x is the ID I got from https://webrtc.nirbheek.in/, the program failed with the following output:

Connecting to server wss://webrtc.nirbheek.in:8443
Error: WebSocketError(IoError(Os { code: 61, kind: ConnectionRefused, message: "Connection refused" }))

The Python example works fine though, so I doubt it's a Firewall issue. Could you provide some insights on what might be the cause here? Let me know if you need more debug info.

@sdroege
Copy link
Contributor

sdroege commented Jul 15, 2019

Can you check with wireshark what it actually tries to do there and attach the capture as pcap/pcapng file? Only the communication with webrtc.nirbheek.in / 176.58.110.251 / 2a01:7e00::f03c:91ff:feae:244 is of interest here.

@zizhengtai
Copy link
Author

I attached two captures below. It seems there are some connection reset thing going on, but I'm really not familiar with this area so I'll leave it to you to take a look. Thanks!

gst-rust-pcapng.zip

@sdroege
Copy link
Contributor

sdroege commented Jul 15, 2019

It's trying to connect to the IPv6 address and that gives "Connection refused". @nirbheek that's one for you :)

Why the ws crate does not try to connect to the IPv4 address afterwards is a good question though. I've forwarded the issue there, let's see what they say. Thanks for reporting.

@sdroege sdroege closed this as completed Jul 15, 2019
@zizhengtai
Copy link
Author

@sdroege, doesn't the example code use websocket instead of ws?

@sdroege
Copy link
Contributor

sdroege commented Jul 15, 2019

🤦‍♂️ Yes. See websockets-rs/rust-websocket#237

nirbheek added a commit that referenced this issue Jul 15, 2019
Empty string or `None` mean all interfaces. Specifying 0.0.0.0 means
ipv4 interfaces only.

Fixes #120
@nirbheek
Copy link
Contributor

The server now listens on ipv4 and ipv6. I've pushed a commit that makes this the default: da27e59

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants