Bug 176921 - Need an option to make LAN connections with WebRTC
Summary: Need an option to make LAN connections with WebRTC
Status: RESOLVED DUPLICATE of bug 174500
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2017-09-14 10:46 PDT by Ashley Gullen
Modified: 2017-09-19 19:18 PDT (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ashley Gullen 2017-09-14 10:46:12 PDT
It appears Safari 11 intentionally blocks the use of local IP addresses in ICE candidates by default, for privacy reasons. However this has the consequence of blocking some important use cases for WebRTC DataChannels, such as:

1) You cannot open two browsers on the same system and connect them. This makes testing WebRTC harder.
2) You cannot connect two browsers on the same LAN. This also makes testing harder, particularly desktop-to-mobile.
3) Local multiplayer - an important case for gaming - is blocked by default.

Running a TURN server works around this, but makes it more expensive to run WebRTC services, and also degrades the experience in the Safari browser. For example local multiplayer games connected over a LAN can enjoy <10ms latency, but routing via the Internet via a TURN server can result in arbitrarily high latency, possibly even making the game unplayable. So for example two users playing a WebRTC-based multiplayer game over a LAN in Chrome on Android will have a far superior experience to users of Safari on iOS, who may experience high latency as the data is needlessly routed around the Internet.

We have a browser-based game development IDE (https://editor.construct.net/) which uses WebRTC for both multiplayer and testing features. The multiplayer features have been summarised already, but the testing features are important too. We have a "Remote Preview" feature that basically lets you scan a QR code on your phone and instantly load up the game for testing. It transfers the entire game across a WebRTC DataChannel. This works great in Chrome, but in Safari it has to route everything via our TURN server. This means to test a game it loads at Internet-speed, rather than at the much higher local bandwidth rate. Some users develop games that are 100mb+, so this can seriously slow down testing as it has to upload and download all the content just to transfer it across their desk. This may encourage users to focus on Android development instead.

I am sure there are other use cases like file transfer services. Transferring a 1GB file over a LAN via your browser could be pretty convenient, but via a TURN server is pretty much impractical to use.

Perhaps there could be a permission prompt or setting to enable this. In Safari on macOS you can enable developer features and disable ICE candidate filtering. It's not ideal, but we could document to all our users that they should do that (but this is probably too inconvenient for multiplayer gamers to bother with). However this option does not appear to be available on iOS, where arguably it's more important. Please provide some kind of option for us to be able to connect over a LAN with WebRTC in Safari.
Comment 1 Jon Lee 2017-09-19 19:18:14 PDT

*** This bug has been marked as a duplicate of bug 174500 ***