WebRTC Client <-> Server
Hey, anyone good with webrtc that can help me demystify this issue.
So we have an app that sort of looks like this (1 server and many clients who want to send their real time audio stream to that server) and the pseudo code of how they connect. this works in localhost but fails when deployed behind nginx, haven't dug into stun and turn servers but is that necessary here? it's not really a normal "peer-to-peer" but more like "peer-to-server" i guess, isn't exchanging sdp's enough in that case?
108 Replies
Is nginx your reverse proxy of choice?
what do you mean of choice
the one you want to use
is webrtc the one that gives you a string that tells other clients how to connect to eachother?
yea the big sdp blob
So, you want a P2P connection? Or do you want to use web rtc to connect to the server ?
p2p but the server is one of the peers i guess haha
but none of the clients need to know about one another
I'm sure nginx makes NAT traversal hard
Right
is there another one i can use?
im so bad with everything network related lol
Websockets? Or are you sending big amounts of data
i can't send an audio stream through websocket can i?
Ah I see
suposedly this nginx config works
no idea though. everyone round here tells me nginx is trash
we got all of that set and it doesn't lo
sounds like what you need
yeah its lua, who knows how it works
Or dosent in this case
i don't understand why i need that though, i thought that was only needed for client-client p2p
If you want it P2P you can do that. Aprantly it can be flaky though
i just wanna send the clients audio stream to the server
Yeah then that diagram should work
it does - for localhost 🙂
when deployed it's just stuck on connecting and checking before eventually disconnecing
Where did I get the word nginx from ? Is it behind an nginx server?
server is ye
it's a nuxt server on a vps behind nginx
That's probably the issue then
@Anna | DevMiner (Rustular CCO) what should Julius use? Nginx or something else
😫
GitHub
my-webrtc-app/nginx.config at master · gornostal/my-webrtc-app
Simple WebRTC App. Contribute to gornostal/my-webrtc-app development by creating an account on GitHub.
im guessing that config works
remind me to respond in 30min
Wait are they just using websockets???
Misleading gh name
@julius can you take nginx out of the equation and see if that works by any chance?
Easiest way to run on ssl without?
lmfao
ughh
use aws anna probbaly has some amazing replacement
Actually i did deploy to vercel (should still work to establish connection on serveriess even if it dies right) before and it behaved the same
estabolsh
Öööö
vercel probbaly does not play well with rtc connections
Yea i mean you’d need a running server for it but i figured just the connection part should work no?
did you enable websocket compatibility in nginx?
Do i need that? We’re not using websockets
this part i think
ye, that
ah so it was nginx at the end of the day ?
probbaly
about tos ee
IDK IM SO LOST HAHA
I hate every second of getting this to work
you hate nginx
understandable
so where do i put this
paste this into your config and chnage the proxypass part
We made some TCP sniffing yday @Finn ( CLOwn )
nginx.conf ?
ya
you have one already right?
yea there's a nginx.conf and some files in sites_enabled
it goes within the
server
block
or whatever
you might need this aswell, but no one knows enough about nginx config to tell you what the path should be
at work i wrote a js script that modifies our nginx config at startup based of some env vars. nginx is literally the worstdid this and same as before
never gets pass the connecting phase
I see Perl
mega based
this should be your url i think
and here
and put that in
that broke everything
that config looks fine without the new location
sounds about right
@julius remove that part
indentation matters there
as well
without which
2nd one
also
if you can
show the nginx.conf file
at the root
of the nginx folder
I use traefik for reverse proxying btw
idk he can do that
doesn't look like any secrets in there
if you wanna call, Julius, im ready in 5min
take that offer if you want to stay sane
yeah
and give anna vscode live share. then go make a coffe
aight, I'm ready
( in #sub-hangouts )
Plasmo Docs
Create a Production Build – Plasmo
How to build a production version of your browser extension.
GitHub
GitHub - node-webrtc/node-webrtc: node-webrtc is a Node.js Native A...
node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M87 - GitHub - node-webrtc/node-webrtc: node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M87
mediasoup
Cutting Edge WebRTC Video Conferencing
mediasoup :: Examples
Cutting Edge WebRTC Video Conferencing
@Nestea (Rustular CDO) was his vpc provider
Problem: UDP ports weren't forwarded
Repro: Deploy on AWS, it works there, block UDP ports, it doesn't work anymore
Solution: Blame provider
yikes
that's amazing
I have never ran into providers that didn't allow me UDP traffic
Wasted way too much time on this shit
Thanks y’all
So just to confirm, this isnt nginx but the provider right?
yep
nginx doesn't do UDP, if you don't configure it
this is a firewall issue
somewhere
hmm i just did ec2 + nginx and got stuck at checking again 😫
this security looks correct right?
or do i need to do something for inbound
nvm ofc i do
inbound needs 0.0.0.0 udp
works now
nice
so i can yell some more at the client then
he said he opened up udp
he also said we should verify that there was no block on the OS - what does that mean
On a base Ubuntu install it shouldn't be an issue
check if
ufw
is enabled
idk, we can call later again, if you wantit's inactive
dw - got plenty of help yesterday. we got a meeting with client on thursday so i'll bug him then 🙂
kk
Haha we’re changing to ec2
Couldnt get the vps to work
Sadge
gonna cost you a lot
x
d
Funny enought I'm dealing with turn server today lol
not my problem, works flawlessly
Make sure your teraform it
And actually set up your networking in a non hacky way
Open it all sounds good to me
All udp I think
Unless there's a port range for web rtc ( don't think there is )
I can set one i think
Ohhh. Interesting