mycrl / turn-rs Goto Github PK
View Code? Open in Web Editor NEWA pure rust implemented turn server.
License: GNU General Public License v3.0
A pure rust implemented turn server.
License: GNU General Public License v3.0
I have a dynamic IP address, so I cannot set my IP address in the config file ahead of time, so what should I do? Also, what is the point of the external
field, isn't bind
enough?
There is an simple example of webrtc-rs using turn-rs, but it does not work.
两者无法链接,能否帮忙看下问题在哪里? (已解决)
webrtc code: https://github.com/ForNetCode/fornet/blob/relay/relay/src/main.rs
turn_server.yaml: https://github.com/ForNetCode/fornet/blob/relay/relay/tun_server_config.toml
webrtc log:
2023-10-22T13:13:38.605501Z INFO webrtc_ice::mdns: mDNS is using 0.0.0.0:5353 as dest_addr
2023-10-22T13:13:38.616239Z INFO webrtc_mdns::conn: Looping and listening Ok(0.0.0.0:5353)
2023-10-22T13:13:38.619656Z INFO relay: Offer: RTCSessionDescription { sdp_type: Offer, sdp: "v=0\r\no=- 7242921887174724487 605323500 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=fingerprint:sha-256 44:0F:BD:67:9D:1F:77:73:22:1F:ED:84:A6:4E:5E:AD:41:8A:20:3C:C0:E3:D3:6C:64:2B:48:19:55:DA:C1:3D\r\na=group:BUNDLE 0\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=setup:actpass\r\na=mid:0\r\na=sendrecv\r\na=sctp-port:5000\r\na=ice-ufrag:zVpjTvrnIxOHBtQp\r\na=ice-pwd:VOTokqhcXeCQBlTgxjyrQEbwgdgCtaOn\r\n", parsed: Some(SessionDescription { version: 0, origin: Origin { username: "-", session_id: 7242921887174724487, session_version: 605323500, network_type: "IN", address_type: "IP4", unicast_address: "0.0.0.0" }, session_name: "-", session_information: None, uri: None, email_address: None, phone_number: None, connection_information: None, bandwidth: [], time_descriptions: [TimeDescription { timing: Timing { start_time: 0, stop_time: 0 }, repeat_times: [] }], time_zones: [], encryption_key: None, attributes: [Attribute { key: "fingerprint", value: Some("sha-256 44:0F:BD:67:9D:1F:77:73:22:1F:ED:84:A6:4E:5E:AD:41:8A:20:3C:C0:E3:D3:6C:64:2B:48:19:55:DA:C1:3D") }, Attribute { key: "group", value: Some("BUNDLE 0") }], media_descriptions: [MediaDescription { media_name: MediaName { media: "application", port: RangedPort { value: 9, range: None }, protos: ["UDP", "DTLS", "SCTP"], formats: ["webrtc-datachannel"] }, media_title: None, connection_information: Some(ConnectionInformation { network_type: "IN", address_type: "IP4", address: Some(Address { address: "0.0.0.0", ttl: None, range: None }) }), bandwidth: [], encryption_key: None, attributes: [Attribute { key: "setup", value: Some("actpass") }, Attribute { key: "mid", value: Some("0") }, Attribute { key: "sendrecv", value: None }, Attribute { key: "sctp-port:5000", value: None }, Attribute { key: "ice-ufrag", value: Some("zVpjTvrnIxOHBtQp") }, Attribute { key: "ice-pwd", value: Some("VOTokqhcXeCQBlTgxjyrQEbwgdgCtaOn") }] }] }) }
2023-10-22T13:13:38.619927Z INFO webrtc::peer_connection: signaling state changed to have-local-offer
2023-10-22T13:13:38.620054Z INFO webrtc::peer_connection: signaling state changed to have-remote-offer
2023-10-22T13:13:38.620301Z INFO webrtc_ice::mdns: mDNS is using 0.0.0.0:5353 as dest_addr
2023-10-22T13:13:38.622968Z INFO webrtc_mdns::conn: Looping and listening Ok(0.0.0.0:5353)
2023-10-22T13:13:38.625754Z INFO webrtc_ice::agent::agent_internal: [controlled]: Setting new connection state: Checking
2023-10-22T13:13:38.625831Z INFO webrtc::peer_connection: signaling state changed to stable
2023-10-22T13:13:38.625963Z INFO webrtc::peer_connection: ICE connection state changed: checking
2023-10-22T13:13:38.625982Z WARN webrtc_ice::agent::agent_internal: [controlled]: pingAllCandidates called with no candidate pairs. Connection is not possible yet.
2023-10-22T13:13:38.703621Z INFO relay: on ice connection: None
2023-10-22T13:13:38.706905Z WARN webrtc_ice::agent::agent_internal: [controlled]: pingAllCandidates called with no candidate pairs. Connection is not possible yet.
2023-10-22T13:13:38.706954Z INFO relay: answer on ice connection: Some(RTCSessionDescription { sdp_type: Offer, sdp: "v=0\r\no=- 7242921887174724487 605323500 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=fingerprint:sha-256 44:0F:BD:67:9D:1F:77:73
:22:1F:ED:84:A6:4E:5E:AD:41:8A:20:3C:C0:E3:D3:6C:64:2B:48:19:55:DA:C1:3D\r\na=group:BUNDLE 0\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=setup:actpass\r\na=mid:0\r\na=sendrecv\r\na=sctp-port:5000\r\na=ice-u
frag:zVpjTvrnIxOHBtQp\r\na=ice-pwd:VOTokqhcXeCQBlTgxjyrQEbwgdgCtaOn\r\n", parsed: Some(SessionDescription { version: 0, origin: Origin { username: "-", session_id: 7242921887174724487, session_version: 605323500, network_type: "IN", addres
s_type: "IP4", unicast_address: "0.0.0.0" }, session_name: "-", session_information: None, uri: None, email_address: None, phone_number: None, connection_information: None, bandwidth: [], time_descriptions: [TimeDescription { timing: Timin
g { start_time: 0, stop_time: 0 }, repeat_times: [] }], time_zones: [], encryption_key: None, attributes: [Attribute { key: "fingerprint", value: Some("sha-256 44:0F:BD:67:9D:1F:77:73:22:1F:ED:84:A6:4E:5E:AD:41:8A:20:3C:C0:E3:D3:6C:64:2B:4
8:19:55:DA:C1:3D") }, Attribute { key: "group", value: Some("BUNDLE 0") }], media_descriptions: [MediaDescription { media_name: MediaName { media: "application", port: RangedPort { value: 9, range: None }, protos: ["UDP", "DTLS", "SCTP"],
formats: ["webrtc-datachannel"] }, media_title: None, connection_information: Some(ConnectionInformation { network_type: "IN", address_type: "IP4", address: Some(Address { address: "0.0.0.0", ttl: None, range: None }) }), bandwidth: [], en
cryption_key: None, attributes: [Attribute { key: "setup", value: Some("actpass") }, Attribute { key: "mid", value: Some("0") }, Attribute { key: "sendrecv", value: None }, Attribute { key: "sctp-port", value: Some("5000") }, Attribute { key: "ice-ufrag", value: Some("zVpjTvrnIxOHBtQp") }, Attribute { key: "ice-pwd", value: Some("VOTokqhcXeCQBlTgxjyrQEbwgdgCtaOn") }] }] }) })
2023-10-22T13:13:38.707266Z INFO relay: answer collect Session Description finish
2023-10-22T13:13:38.707455Z INFO webrtc::peer_connection: signaling state changed to stable
2023-10-22T13:13:38.707660Z INFO webrtc_ice::agent::agent_internal: [controlling]: Setting new connection state: Checking
2023-10-22T13:13:38.707750Z INFO webrtc::peer_connection: ICE connection state changed: checking
2023-10-22T13:13:38.920682Z WARN webrtc_ice::agent::agent_internal: [controlled]: pingAllCandidates called with no candidate pairs. Connection is not possible yet.
2023-10-22T13:13:39.125836Z WARN webrtc_ice::agent::agent_internal: [controlled]: pingAllCandidates called with no candidate pairs. Connection is not possible yet.
2023-10-22T13:13:39.343719Z WARN webrtc_ice::agent::agent_internal: [controlled]: pingAllCandidates called with no candidate pairs. Connection is not possible yet.
2023-10-22T13:13:39.558588Z WARN webrtc_ice::agent::agent_internal: [controlled]: pingAllCandidates called with no candidate pairs. Connection is not possible yet.
2023-10-22T13:13:39.760740Z WARN webrtc_ice::agent::agent_internal: [controlled]: pingAllCandidates called with no candidate pairs. Connection is not possible yet.
turn-rs log:
2023-10-22T13:13:38.717Z INFO [turn_server::observer] auth: addr=120.235.172.61:4415, name="offer", pwd=Some("test")
2023-10-22T13:13:38.717Z INFO [turn_server::observer] allocate: addr=120.235.172.61:4415, name="offer", port=55168
2023-10-22T13:13:38.719Z INFO [turn_server::observer] auth: addr=120.235.172.61:4416, name="answer", pwd=Some("test")
2023-10-22T13:13:38.719Z INFO [turn_server::observer] allocate: addr=120.235.172.61:4416, name="answer", port=63488
2023-10-22T13:13:38.760Z INFO [turn_server::observer] create permission: addr=120.235.172.61:4415, name="offer", realy=113.31.103.71:63488
2023-10-22T13:13:38.798Z INFO [turn_server::observer] channel bind: addr=120.235.172.61:4415, name="offer", number=16384
Use aya to implement the ebpf layer, filter udp traffic in ebpf, and the user mode decides where to forward the data packets. Currently, it is only for channel data
traffic in ebpf to forward.
News?
As the turn is too important for video communication systems like Jitsi , BBB
I'm using coturn on docker also tried a Stunner recently
none of them has a proper solution for deploying the turn service on K8s
via FQDN and tls 443 ( cert-manager) support.
It will be great if this rust-based turn project can be deployed with those requirements.
#kubernetes #cert-manager #turn #coturn
This is an awesome project! I'm curious though, why not use WebRTC.rs?
Hi there,
I'm looking for a TURN and a STUN server to add to my project. Is it possible to use your server as a library?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.