I'm working on a corporate network that blocks incoming UDP packets. While LAN works, I've noticed that playing with the relay server fails, and some investigation with Wireshark revealed it to be that Unity Multiplayer seems almost entirely UDP based. 1) Are there any plans to implement TCP tunnelling for cases like that, or any workaround ways to do it myself? 2) Also, is there any way we can swap out Unity Multiplayer's current transport layer for a custom one? For reference, see the article https://alexfreska.svbtle.com/webrtc-not-quite-magic and scroll to the bottom. I believe the same stuff that applies to WebRTC applies here.
Yes, Unity Multiplayer is mostly UDP with different reliability settings and for WebGL Websockets. As far as I know there is no way to use TCP with the new Networking System. You could use a proxy that just forwards all the UDP data over a TCP connection but that would probably be a bitch to do.
@Necromantic thanks! Now I'd be interested to hear if there are any plans to implement TCP in the future, or at least if there is a way to switch out the transport layer. Yeah, a local proxy would work, but ideally we wouldn't have to do that.
Yes we have plans to support TCP, when? It is one of priority task... And thanks for reference. WebSocket support implemented with the same idea inside. User still sending messages, but internally it is a web-socket/tcp tunneling.
FYI there is an IRC channel now on irc.freenode.net (#unity3d-unet). Also, some shared resources are gathered here: https://goo.gl/UmBBpM
For games that only need reliable communication, like ours, it seems to me that the websockets option should be available for all platforms, as that sends and receives via TCP. What is the advantage of creating a TCP QoS vs sending Unreliable QoS through websockets?
It should be possible to do HLAPI over TCP using "external connections". This project has some examples of using them: http://forum.unity3d.com/threads/unet-hlapi-sample-custom-connection-classes.375595/ Essentially you would create a TcpNetworkConnection class derived from NetworkConnection, and connect it yourself using TCP, then add it to the NetworkServer and NetworkClient using AddExternalConnection. Then override the TransportSend() and TransportRecieve() functions to route to a TCP socket that it owns.