Remote preview now uses TURN server

Post » Tue May 30, 2017 12:32 pm

tl;dr - if you previously had connection problems using Remote Preview, it should work now.

We're now running a TURN server for Remote Preview. Since Remote Preview uses peer-to-peer WebRTC connections (much like the multiplayer engine), due to the architecture of the Internet, about ~10% of the time peers cannot directly reach each other. The solution is to use a TURN server which acts as a relay: both peers connect to the TURN server, and that relays data between the two peers.

This means if you previously had trouble connecting with Remote Preview (particularly likely over cell data connections like 3G/4G), it ought to now work, since the TURN server will act as a relay.

I did briefly test this myself: before the change I could not host a remote preview on my phone using a 4G cell data connection; once I set up the TURN server, it then worked. So you can host remote previews even over cell data now! (although Wifi is probably better to avoid running up your bandwidth bills :P)

However it's kind of a tricky thing to test since it depends on finding peers that can't connect and then seeing if the TURN server resolves that. So I'd be interested to hear from anyone who's had trouble connecting with Remote Preview. If it failed previously, does it work now?
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Tue May 30, 2017 3:27 pm

I tested the remote preview with five friends today and it worked really well. Just to let you know. :)
Image
B
39
S
14
G
2
Posts: 120
Reputation: 3,454

Post » Tue May 30, 2017 8:52 pm

Works fine on a 3G connection, although I didn't really test it before so it might also have worked before. :P

Sorry to be "that guy" but would it be possible to also use this TURN server inside the multiplayer plugin?
I'd guess that this would/could solve a lot of multiplayer issues that our mobile dev's have to deal with fairly often.
ImageImageImageImage
B
56
S
21
G
77
Posts: 636
Reputation: 43,961

Post » Wed May 31, 2017 10:07 am

TheRealDannyyy wrote:Sorry to be "that guy" but would it be possible to also use this TURN server inside the multiplayer plugin?

We won't permanently run a high-bandwidth server for a free service. You can always run your own TURN server if you are so inclined.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Wed May 31, 2017 1:42 pm

Hello everyone! When I update a project on computer with remote preview activated, nothing happens on mobile devices (I have to rescan QR code again and again to see changes). Is it normal? It's really nice to have this new functionality with C3 but I hope we will have, like with C2, an additional and more instantaneous localhost preview in a future release and the standalone version.
B
36
S
14
G
9
Posts: 62
Reputation: 7,173

Post » Wed May 31, 2017 5:52 pm

Sebastien wrote:Hello everyone! When I update a project on computer with remote preview activated, nothing happens on mobile devices (I have to rescan QR code again and again to see changes). Is it normal?

In this case the mobile device should show a notification saying "host updated project". Once you see that, just hit refresh and you should get the latest project. You need to leave the remote preview window open though, you can carry on editing the project while it's open.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Wed May 31, 2017 5:58 pm

Today i tried to make remote preview and it did not work, from my end i saw him tring to connect for 5-10 sec then connection dropped, just like before TURN server. Could there be a way from my end or other, to see why the connection drop?
B
30
S
20
G
14
Posts: 17
Reputation: 9,874

Post » Wed May 31, 2017 7:17 pm

Thanks @Ashley, but there is actually and for me no message after updating/saving changes (Chrome updated, only messages for host disconnected). Nothing too when relaunching the preview (ok URL is different, but it will be perhaps an alternative). The only thing I can do is indeed to refresh the page (and it's in any case a slow reload of everything, time consuming and a pain for testing, please come back with localhost/ip preview again, it was automatic and very fast).
B
36
S
14
G
9
Posts: 62
Reputation: 7,173

Post » Wed May 31, 2017 10:00 pm

@Ashley, I don't know why, or perhaps I was too distracted with this furtive notification (however I tried again before answering), but now it works on mobile devices (phone+tablet)! I have to click again on the remote preview button to see appear the "host updated project" message. Do we have a keyboard shortcut on the host to relaunch a preview again? And can we have an automated refresh option for clients? Thanks. @SnipG: I don't know what is really your issue but previously I had to update Chrome on all mobile devices and setup this browser by default too, since it works better.
B
36
S
14
G
9
Posts: 62
Reputation: 7,173


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests