没有冰/眩晕/转向服务器的隔离 LAN 上的 WebRTC [英] WebRTC on isolated LAN without ice/stun/turn server

查看:28
本文介绍了没有冰/眩晕/转向服务器的隔离 LAN 上的 WebRTC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个孤立的局域网上,有没有什么办法可以简单地使用 DHCP 服务器分配的 IP 地址建立 WebRTC 连接?

On an isolated LAN, is there any way that a WebRTC connection can be made simply with the IP addresses assigned by the DHCP server?

我知道我可以使用 Node.js 和 Socket.io 来实现这一点 - 但我真的希望避免以我有限的技能设置那种服务器.我是一名涉足编程的科学老师,所以请随意保持简单.谢谢!

I understand that I can accomplish this with Node.js and Socket.io - but I was really hoping to avoid setting up that kind of server with my limited skill set. I'm a science teacher who dabbles in programming, so feel free to keep it simple. Thank you!

Alex,你说得对,如果所有计算机都在同一个本地网络上,我可以避免使用 STUN 服务器.虽然我不得不硬着头皮在我的笔记本电脑上安装 Node.js,但这并不复杂.然后我尝试了一大堆对我不起作用的工作示例",直到我找到 这个 和他的 GitHub 文件.

Alex, you are correct that I can avoid using a STUN server if all of the computers are on the same local network. Although I had to bite the bullet and install Node.js on my laptop, it was really wasn't complicated. I then tried a whole bunch of 'working examples' that didn't work for me, until I found this one and his GitHub files.

在 Node 中运行服务器脚本后,我在同一台机器上的两个浏览器窗口之间建立了 DataChannel 连接,但在不同计算机之间没有.我编辑了 .html 文件以指向我的本地服务器 IP 地址而不是 localhost,然后我可以连接多台计算机.然后是真正的测试 - 我可以在没有互联网连接的情况下使用它吗?我找到了使用 Google 的 STUN 服务器指定的行并将其从

After running the server script in Node, I had a DataChannel connection between two browser windows on the same machine, but not between different computers. I edited the .html files to point to my local server IP address instead of localhost and I could then connect with multiple computers. Then came the real test - could I use this without an internet connection? I found the line that specified using Google's STUN servers and changed it from

var config = {"iceServers":[{"url":"stun:stun.l.google.com:19302"}]};

只是

var config = {"iceServers":[]};

推荐答案

Alex,你说得对,如果所有计算机都在同一个本地网络上,我可以避免使用 STUN 服务器.虽然我不得不硬着头皮在我的笔记本电脑上安装 Node.js,但这并不复杂.然后我尝试了一大堆对我不起作用的工作示例",直到我找到了这个和他的 GitHub 文件.

Alex, you are correct that I can avoid using a STUN server if all of the computers are on the same local network. Although I had to bite the bullet and install Node.js on my laptop, it was really wasn't complicated. I then tried a whole bunch of 'working examples' that didn't work for me, until I found this one and his GitHub files.

在 Node 中运行服务器脚本后,我在同一台机器上的两个浏览器窗口之间建立了 DataChannel 连接,但在不同计算机之间没有.我编辑了 .html 文件以指向我的本地服务器 IP 地址而不是 localhost,然后我可以连接多台计算机.然后是真正的测试 - 我可以在没有互联网连接的情况下使用它吗?我找到了使用 Google 的 STUN 服务器指定的行并将其更改为

After running the server script in Node, I had a DataChannel connection between two browser windows on the same machine, but not between different computers. I edited the .html files to point to my local server IP address instead of localhost and I could then connect with multiple computers. Then came the real test - could I use this without an internet connection? I found the line that specified using Google's STUN servers and changed it from

var config = {"iceServers":[{"url":"stun:stun.l.google.com:19302"}]};

var config = {"iceServers":[{"url":"stun:stun.l.google.com:19302"}]};

只是

var config = {iceServers":[]};

var config = {"iceServers":[]};

这篇关于没有冰/眩晕/转向服务器的隔离 LAN 上的 WebRTC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆