stun

How to do NAT with PHP sockets

本小妞迷上赌 提交于 2019-12-04 12:31:46
I'm trying to make a peer to peer app in php to work in the same kind of way skype works. It works with internal addresses, but when I try to send data to my external address the message never gets there. Obviously I'm missing some address translation, but I'm at a loss for how to do that with PHP sockets. Is it possible? This is the code i have at the moment to receive the message, which I run first to wait for some message: <?php $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("Could not create socket: " . socket_strerror(socket_last_error($socket))); socket_bind($socket, "0.0.0

HTTP Server behind NATs

假装没事ソ 提交于 2019-12-04 12:26:17
问题 I'm trying to make an (apache) server behind multi-layered NAT to be accessible from Internet. Restrictions: Avoid relay. There is a public server (we call him the OldMan) for login / stun, but its bandwidth is too poor to carry relay data. I have no right to configure the NATs manually. 3.User don't have to change their browser or device.(that is, works on android, ios, and any PC) I tried UPnP , but it only works on 1-layered NAT . I tried to search NAT traversal solutions for several

UDP/TCP hole punching vs UPnP vs STUN vs?

梦想与她 提交于 2019-12-04 08:49:05
I try to make a P2P Program and need help with getting through the NAT of the clients. I have read many questions here on stackoverflow, but i never got what the drawbacks and benefits of all the Methods to get through a NAT are. How many routers support which methods? Which methods are commonly used by the big companies? (BitTorrent, TeamViewer,...) What are the drawbacks/benefits of the three methods i listed and which else exists? UPnP requires software support in your router. Even when routers have it, it's sometimes turned off due to security concerns. STUN uses a simple public server to

What is STUN and does it need a port-forwarded server?

回眸只為那壹抹淺笑 提交于 2019-12-03 16:16:18
问题 I've done some research on p2p communication without a base server, and came over STUN. From what I've read, STUN is a way of NAT "Hole Punching" that would not require a peer to be port-forwarded to be connected to. Is this correct, and what exactly does hole punching mean? It all seems very vulnerable as it is going past the firewall if it does not require port-forwarding, and I do not entirely understand what STUN does. Could STUN be used in a p2p program in Java or another language such

WebRTC

耗尽温柔 提交于 2019-12-03 10:52:58
WebRTC是HTML5支持的重要特性之一,有了它,不再需要借助音视频相关的客户端,直接通过浏览器的Web页面就可以实现音视频对聊功能。而且WebRTC项目是开源的,我们可以借助WebRTC源码快速构建自己的音视频对聊功能。无论是使用前端JS的WebRTC API接口,还是在WebRTC源码上构建自己的对聊框架,都需要遵循以下执行流程: 上述序列中,WebRTC并不提供Stun服务器和Signal服务器,服务器端需要自己实现。Stun服务器可以用google提供的实现stun协议的测试服务器(stun:stun.l.google.com:19302),Signal服务器则完全需要自己实现了,它需要在ClientA和ClientB之间传送彼此的SDP信息和candidate信息,ClientA和ClientB通过这些信息建立P2P连接来传送音视频数据。由于网络环境的复杂性,并不是所有的客户端之间都能够建立P2P连接,这种情况下就需要有个relay服务器做音视频数据的中转,本文本着源码剖析的态度,这种情况就不考虑了。这里说明一下, stun/turn、relay服务器的实现在WebRTC源码中都有示例,真是个名副其实的大宝库。 上述序列中,标注的场景是ClientA向ClientB发起对聊请求,调用描述如下: ClientA首先创建PeerConnection对象

NAT traversal using free STUN and TURN servers in C#

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is my previous post: NAT Traversal using only free STUN and TURN servers in C# I am making an online application that communicates with each other peer-to-peer. Most users are expected to be in their private network behind a NAT, and I need to traverse it. I can't afford an external server, so the only things that I can depend on is free servers like Numb (which means I cannot provide my own implementation or extension of it.) However, after some research, I couldn't figure out how to use such servers. I didn't find a library that could

Apprtc with coturn STUN/TURN server

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Simply, I am going run locally popular example of WEBRTC app: github.com/webrtc/apprtc The apprtc installed, and even works locally without turn server ( "Same origin policy" don't allow use Google TURN server, which works only from apprtc.appspot.com: access-control-allow-origin:" https://apprtc.appspot.com "). But I know that in real internet world (nats and firewalls) I need turn server. So I have decided to use own STUN/TURN server: code.google.com/p/coturn/ I am trying integrate my apprtc with coturn: +apprtc: http://localhost:8080/

HTTP Server behind NATs

*爱你&永不变心* 提交于 2019-12-03 07:20:56
I'm trying to make an (apache) server behind multi-layered NAT to be accessible from Internet. Restrictions: Avoid relay. There is a public server (we call him the OldMan) for login / stun, but its bandwidth is too poor to carry relay data. I have no right to configure the NATs manually. 3.User don't have to change their browser or device.(that is, works on android, ios, and any PC) I tried UPnP , but it only works on 1-layered NAT . I tried to search NAT traversal solutions for several months, but in vain. I study STUN/TURN/ICE ,and tried pjsip (icedemo.exe + numb), however, its stun cannot

Whether STUN server is needed within LAN for WebRTC?

无人久伴 提交于 2019-12-03 07:09:52
问题 I have developed a p2p video chat using Webrtc. I am aware that STUN or TURN server is required to identify the public IP behind NAT. Currently am using Google's STUN server. I have the application installed in the server connected to the LAN which will not have internet access, do I need to install the STUN server in my server to make Webrtc video chat work within the LAN? 回答1: Peers should be able to connect within a LAN (on the same side of a NAT) without STUN, i.e. using the host

How does WebRTC handle many-to-many connections?

ぐ巨炮叔叔 提交于 2019-12-03 06:13:08
if I am in a room with other 7 users, I am wondering if WebRTC force every user to establish a connection to each one of other participants. Obviously it would consume something like 7kb/s*7 download and even upload, and many connection cannot handle this if their connection is already busy. Instead with some kind of media relay the bandwidth usage would be only 7kb/s but you would lose bandwidth adaptation between peers. Do you know any media relay, or way to solve this problem? is TURN server ( like https://code.google.com/p/rfc5766-turn-server/ ) suitable for this kind of job ( multicast