HTML5 Networking listen server issues

I’m using unreal 4.10.2 and trying to get the experimental HTML5 networking running in some way.

I followed the instructions on the plugin’s page here and the socket networking works for Windows builds. However, I get the following error when trying to connect from a Firefox game client to a Firefox game listen server.

[2016.01.11-21.37.00:146][ 0]LogHTML5Launch:Display: Init Complete
[2016.01.11-21.37.00:367][ 0]LogRenderer: Reallocating scene render targets to support 800x600 (Frame:4).
[2016.01.11-21.41.26:402][353]LogInit: BSD: I am cherrypiegames.com (172.29.1.0:0)
[2016.01.11-21.41.28:036][443]LogRenderer: Reallocating scene render targets to support 1808x1356 (Frame:15448).
[2016.01.11-21.44.25:788][102]LogNet: Browse: 192.168.1.203//Game/Maps/Menu/MainMenu
L
[2016.01.11-21.44.25:790][102]LogHTML5Networking:Warning: Socked 4 created
L
[2016.01.11-21.44.25:792][102]LogHTML5Networking:Warning: Connect socket returned -1
[2016.01.11-21.44.25:793][102]LogNet: GetLocalNetworkVersion: GEngineNetVersion: 2818068, ProjectName: agileliteracyproject, ProjectVersion: 1.0.0.0, InternalProtocolVersion: 9, LocalNetworkVersion: 2342398339 

Is there something that I am missing to make HTML5 networking work, besides enabling the plugin and making the ini changes? It’s necessary for a project I am currently working on. A user said something on this page about changing the .html file’s IP address but I’m not sure what that means. Is a dedicated or windows server required for HTML5 to connect to? Thank you!

Hi Tarwine,

Have you been able to get HTML5 to work normally? What steps are you taking that cause this to occur?

Please keep in mind this is an experimental feature and as such is not completely tested or implemented, we cannot guarantee it will function as intended.

Hi Tarwine,

We have not heard from you in several days. I am marking this as answered for tracking purposes. If you are still experiencing this error, please comment with the requested information.

Sorry for the late response.

I can get HTML5 to work if I don’t attempt to connect to another client. Singleplayer levels work. When I go to my server browser that calls the Find Sessions node, no servers appear even if another user is hosting on the local network. Typing in their address via "open " gives me the error I have posted.

I know that it’s experimental, I’m just trying to narrow down the problem and if possible fix any errors on my end. I have switched back to a windows build for the project and am currently waiting for progress on HTML5 Networking before I start building for that again.

Hi Tarwine,

I wanted to let you know I am still looking into this. Unfortunately I cannot guarantee that I will be able to assist much further as the feature is experimental, but I’ll see what I can do.

I am also getting the exact same problem. My game can connect to a remote dedicated server just fine when packaged for windows. However, when I package it as HTML5, the HTML5Networking plugin gives me this:

I have followed the instructions of the HTML5Networking plugin after discovering this problem but had no luck. Please let me know if there is an answer to this problem. Many thanks!

Can you post the output from the web browser console window? To do so

Press Ctrl+Shift+I (as in ‘eye’)
Click on the console tab
scan for any red error lines in that window

Can you post what errors you are seeing when you do this?

I am actually having the exact problem – i can connect to a server just fine in standalone, but HTML5 seems to fail. It also appears as tho the web browser thinks it is a server by default.

Hi r4ptur3,

Can you post the output from the web browser console window? Press Ctrl+Shift+I (as in ‘eye’) Click on the console tab scan for any red error lines in that window

Can you post what errors you are seeing when you do this?

Hi Adam!

Thank you so much for the quick response! There were two errors:

** XMLHttpRequest cannot load https://datarouter.ol.epicgames.com/datarouter/api/v1/public/data?SessionID…c/data?SessionID={002B0601-2608-1119-0031-02EA00B4C809}&AppID=UEGame.R. Request header field Pragma is not allowed by Access-Control-Allow-Headers in preflight response.

** WebSocket connection to ‘ws://74.213.249.254:8889/’ failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT

I have both ports 7777 and 8889 forwarded to my PC and the standalone windows exe seems to be able to connect to eachother just fine. I am running the console command ‘ThirdPersonExampleMap?listen’ when I press the M key (i use the windows exe for this) and the console command ‘open 74.213.249.254:7777’ with the J key (i am pressing this in the browser). Any thoughts would be awesome! It looks like tons of other people are having the same issue and giving up. Thanks in advance!!!

–Kyle

EDIT: in addition:

when I press M to load the map in listen mode I get the following in the in-browser log:

[2016.08.26-01.01.24:326][ 0]LogNet: Browse: /Game/BP/Maps/ThirdPersonExampleMap?listen
[2016.08.26-01.01.24:327][ 0]LogLoad: LoadMap: /Game/BP/Maps/ThirdPersonExampleMap?listen
[2016.08.26-01.01.24:330][115]LogNet: World NetDriver shutdown WebSocketNetDriver_1 [GameNetDriver]
[2016.08.26-01.01.24:330][ 37]LogNet: DestroyNamedNetDriver WebSocketNetDriver_1 [GameNetDriver]
[2016.08.26-01.01.24:465][108]LogMemory: Platform Memory Stats for HTML5
[2016.08.26-01.01.24:465][ 50]LogMemory: Process Physical Memory: 0.00 MB used, 0.00 MB peak
[2016.08.26-01.01.24:466][102]LogMemory: Process Virtual Memory: 0.00 MB used, 0.00 MB peak
[2016.08.26-01.01.24:466][101]LogMemory: Physical Memory: 512.00 MB used, 512.00 MB total
[2016.08.26-01.01.24:466][100]LogMemory: Virtual Memory: 0.00 MB used, 0.00 MB total
[2016.08.26-01.01.24:466][11509680]LogMemory:
[2016.08.26-01.01.24:466][111]Allocator Stats for ANSI: (not implemented)
[2016.08.26-01.01.24:530][ 32]LogAIModule: Creating AISystem for world ThirdPersonExampleMap
[2016.08.26-01.01.24:561][ 0]LogWorld: Game class is 'ThirdPersonGameMode_C'
[2016.08.26-01.01.24:576][ 97]LogWorld: Bringing World /Game/BP/Maps/ThirdPersonExampleMap.ThirdPersonExampleMap up for play (max tick rate 0) at 2016.08.25-18.01.24
[2016.08.26-01.01.24:578][116]LogWorld: Bringing up level for play took: 0.014290
LogLongPackageNames:Warning: URL: :8889//Game/BP/Maps/ThirdPersonExampleMap: Name may not contain the following characters: :
[2016.08.26-01.01.24:579][ 0]LogLongPackageNames:Warning: URL: :8889//Game/BP/Maps/ThirdPersonExampleMap: Name may not contain the following characters: :
[2016.08.26-01.01.24:617][ 37]LogLoad: Took 0.290365 seconds to LoadMap(/Game/BP/Maps/ThirdPersonExampleMap)
[2016.08.26-01.01.24:645][3598]r.SetRes = "1024x480w"

when I press J to join a host map I get the following:

[2016.08.26-01.02.15:485][ 0]LogNet: Browse: 74.213.249.254//Game/BP/Maps/ThirdPersonExampleMap
[2016.08.26-01.02.15:486][115]LogNet: World NetDriver shutdown WebSocketNetDriver_2 [GameNetDriver]
[2016.08.26-01.02.15:486][ 37]LogNet: DestroyNamedNetDriver WebSocketNetDriver_2 [GameNetDriver]
LogHTML5Networking:Warning: Socked 3 created
[2016.08.26-01.02.15:498][ 0]LogHTML5Networking:Warning: Socked 3 created
LogHTML5Networking:Warning: Connect socket returned -1
[2016.08.26-01.02.15:528][ 0]LogHTML5Networking:Warning: Connect socket returned -1
[2016.08.26-01.02.15:537][101]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2016.08.26-01.02.15:547][103]LogNet: GetLocalNetworkVersion: GEngineNetVersion: 3039270, ProjectName: inward, ProjectVersion: 1.0.0.0, InternalProtocolVersion: 9, LocalNetworkVersion: 2930132400

Hi r4ptur3,

Try removing the : from your map name. I see in your first logs here:

LogLongPackageNames:Warning: URL: :8889//Game/BP/Maps/ThirdPersonExampleMap: Name may not contain the following characters: :
[2016.08.26-01.01.24:579][ 0]LogLongPackageNames:Warning: URL: :8889//Game/BP/Maps/ThirdPersonExampleMap: Name may not contain the following characters: :

Does this fix the error you are seeing on your end?

Hey Adam!

Thank you for the reply! I’ll try this as soon as I get home from work. Does this mean I do not have to specify a port when trying to join a server? If so, all I need to do is specify an IP address?

‘open [IP address]’ instead of ‘open [IP address]:7777’

–Kyle

OK, I was able to do some tests last night. I am still unable to connect – here are the results:

Ctrl+Shift+I yields the following errors:

XMLHttpRequest cannot load https://datarouter.ol.epicgames.com/datarouter/api/v1/public/data?SessionID…c/data?SessionID=%7B002B8E97-0908-171D-000B-004300C7C54B%7D&AppID=UEGame.R. Request header field Pragma is not allowed by Access-Control-Allow-Headers in preflight response.
2WebSocket connection to 'ws://74.213.249.254:8889/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT

The M key now uses “console command” instead of “open level” and uses the command ‘open ThirdPersonExampleMap?listen’ . I get the following error in the console:

[2016.08.30-06.16.55:458][ 0]LogNet: Browse: /Game/BP/Maps/ThirdPersonExampleMap?listen
[2016.08.30-06.16.55:459][ 0]LogLoad: LoadMap: /Game/BP/Maps/ThirdPersonExampleMap?listen
[2016.08.30-06.16.55:590][108]LogMemory: Platform Memory Stats for HTML5
[2016.08.30-06.16.55:590][ 50]LogMemory: Process Physical Memory: 0.00 MB used, 0.00 MB peak
[2016.08.30-06.16.55:590][102]LogMemory: Process Virtual Memory: 0.00 MB used, 0.00 MB peak
[2016.08.30-06.16.55:591][101]LogMemory: Physical Memory: 512.00 MB used, 512.00 MB total
[2016.08.30-06.16.55:592][100]LogMemory: Virtual Memory: 0.00 MB used, 0.00 MB total
[2016.08.30-06.16.55:592][11509680]LogMemory:
[2016.08.30-06.16.55:592][111]Allocator Stats for ANSI: (not implemented)
[2016.08.30-06.16.55:652][ 32]LogAIModule: Creating AISystem for world ThirdPersonExampleMap
[2016.08.30-06.16.55:682][ 0]LogWorld: Game class is 'ThirdPersonGameMode_C'
[2016.08.30-06.16.55:700][ 97]LogWorld: Bringing World /Game/BP/Maps/ThirdPersonExampleMap.ThirdPersonExampleMap up for play (max tick rate 0) at 2016.08.29-23.16.55
[2016.08.30-06.16.55:704][116]LogWorld: Bringing up level for play took: 0.018950
LogLongPackageNames:Warning: URL: :8889//Game/BP/Maps/ThirdPersonExampleMap: Name may not contain the following characters: :
[2016.08.30-06.16.55:705][ 0]LogLongPackageNames:Warning: URL: :8889//Game/BP/Maps/ThirdPersonExampleMap: Name may not contain the following characters: :
[2016.08.30-06.16.55:738][ 37]LogLoad: Took 0.279060 seconds to LoadMap(/Game/BP/Maps/ThirdPersonExampleMap)
[2016.08.30-06.16.55:760][3598]r.SetRes = "1024x480w"

It looks like the game is sticking a ’ : ’ in the command even tho I have clearly avoided it.

Using the J key runs the “console command” ‘open 74.213.249.254:7777’ and throws the following to the console:

[2016.08.30-06.19.05:699][ 0]LogNet: Browse: 74.213.249.254//Game/BP/Maps/ThirdPersonExampleMap
[2016.08.30-06.19.05:699][115]LogNet: World NetDriver shutdown WebSocketNetDriver_4 [GameNetDriver]
[2016.08.30-06.19.05:700][ 37]LogNet: DestroyNamedNetDriver WebSocketNetDriver_4 [GameNetDriver]
LogHTML5Networking:Warning: Socked 3 created
[2016.08.30-06.19.05:712][ 0]LogHTML5Networking:Warning: Socked 3 created
LogHTML5Networking:Warning: Connect socket returned -1
[2016.08.30-06.19.05:747][ 0]LogHTML5Networking:Warning: Connect socket returned -1
[2016.08.30-06.19.05:757][101]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2016.08.30-06.19.05:764][103]LogNet: GetLocalNetworkVersion: GEngineNetVersion: 3039270, ProjectName: inward, ProjectVersion: 1.0.0.0, InternalProtocolVersion: 9, LocalNetworkVersion: 2930132400

If I do not specify a port with ’ : ’ the windows 64 standalone version fails to connect to itself. Standalone works fine right now, HTML5 fails to connect.

You can also find the game here:

http://www.rapture-art.com/inward/inwardRUN.html

and for all the files:

http://www.rapture-art.com/inward/

Is HTML5 multiplayer not supported? Is there any working example of a HTML5 game connecting to a server via blueprint (or any method, for that matter)? Thanks so much in advance!

bump – any info on this?

r4plur3 - i see that you are running 4.12

in that version, the websocket connections become broken due to a new handshaking mechanism that was implemented for IpNetDriver – but not for WebSocketNetDriver.

i just wrote the handshaking mechanism for WebSocketNetDriver a couple of weeks ago – unfortunately, this code did not make it in for the 4.13 lockdown.

this should be fixed for 4.14.

apologies for the broken feature.

thank you so much for the reply!

I’ll spread the word :slight_smile: I know many other people were interested in this feature as well. Do you know which version was the last one to support this feature, and when 4.14 preview 1 might pop up?

Hi r4ptur3,

Unfortunately the preview information is not available at present.

Hey there!

I was super happy to see this issue was addressed in the 4.14 patch notes … but very disappointed to see it had not actually been fixed. Same error : /

A 4.14 build has been re-uploaded to:
http://www.rapture-art.com/inward/inwardRUN.html

M runs the blueprint command:
Open Level ThirdPersonExampleMap?listen

J runs the blueprint command:
open 74.213.249.254:7777

Y will toggle the cube on the far end of the map on and off if you are the server. (defaults to on, press a few times to see it function). The browser version of the game always thinks it is a server by default.

Again, all ports are forwarded correctly. When I run the win64 exe I can connect to myself. When I run through a web browser I can not connect to another browser that is hosting or the win64 exe.

Any help would be super appreciated! This is such a cool and much needed feature! Is there a working example we could see? Thanks in advance :slight_smile:

a few notes:

Is a dedicated or windows server required for HTML5 to connect to?

a web browser cannot “host” (i.e. be a game server) ever. web standards will not allow “listen” (i.e. accept connections) from the browser endpoint.

websockets will allow communications between a “request” initiated connection. so yes, this means you will need a “live” server out there in the wild for the browsers to “connect to”.

datarouter.ol.epicgames.com … not allowed by Access-Control-Allow-Headers

this should be fixed by Epic IT’s servers by now – but, you can ignore these.

however… there’s another issue this needs to be addressed – later below

open 74.213.249.254:7777

this means, from my game client – open a connection to 74.213.249.254 port #7777

and 74.213.249.254, again, does not mean your browser – but an executable that is listening at port (in this example) 7777 (which native ue4 games can do – but, specifically: standalone game server…).

Is HTML5 multiplayer not supported?

it is supported, you need to run the UE4 game (standalone) server with WebSocketNetDriver enabled:

  • edit: Engine\Config\BaseEngine.ini

– comment out any and all existing NetDriverDefinitions
– and then add

NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName="/Script/HTML5Networking.WebSocketNetDriver",DriverClassNameFallback="/Script/HTML5Networking.IpNetDriver")

Access-Control-Allow-Headers

finally, since this happens with cook-on-the-fly (it’s websocket driven for HTML5) – this is currently messed up. first, someone disabled the network file system for websockets… i fixed it by filling in the missing “packet modifier” implementation for websockets (they only did the pure TCP sockets version).

then, someone disabled it again – hiding some issues for websocket processing (which i’m close to finishing up) – but, the CORS issue will be broken for 4.14… (sigh…) i will post any of my findings back here when i get it all wrapped up.

thank you so much Nick!!

I am so sorry I am being such a squeaky wheel >< Thank you so much for the help and explanations!!! I know I am not the only one looking for this functionality – there is so much potential!

–kyle