[HTML5Networking Plugin] Crashes when try to join via 127.0.0.1

Dear Epic and Ankitkk,

I am trying to use the HTML5Networking plugin for multiplayer HTML5 game test :slight_smile:

What I’ve done, in a 4.10 release/launcher engine version:

I get crashes in these 3 cases:

  • Just open two instance of the game, not even involving packaging the game, use open ?listen to make one a listen server, try to join with other vai 127.0.0.1, get crash as shown below

  • Test HTML5 locally (not uploaded to a server), tried making HTML5 build the host, tried having local developer build join, developer build crashes with crash shown below

  • Try having the local HTML5 build join the developer build who is hosting as open ?listen, crash occurs for developer build as shown below

The Crash

Access violation - code c0000005 (first/second  not available)

""

UE4Editor_HTML5Networking!FWebSocket::unreal_networking_server()
UE4Editor_HTML5Networking!handshake_0405()
UE4Editor_HTML5Networking!lws_handshake_server()
UE4Editor_HTML5Networking!libwebsocket_read()
UE4Editor_HTML5Networking!lws_server_socket_service()
UE4Editor_HTML5Networking!libwebsocket_service_fd()
UE4Editor_HTML5Networking!lws_plat_service()
UE4Editor_HTML5Networking!UWebSocketNetDriver::TickDispatch()
UE4Editor_Engine!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void __cdecl(float)>::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:772]
UE4Editor_Engine!TBaseMulticastDelegate<void,float>::Broadcast() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:809]
UE4Editor_Engine!UWorld::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\leveltick.cpp:1062]
UE4Editor_Engine!UGameEngine::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\gameengine.cpp:936]
UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\launchengineloop.cpp:2427]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

#Solution?

How to get rid of these crashes so I can have a real HTML5 Multiplayer game?

#Thanks!

,

Looking over the stack trace, it seems that there is a broken “handshake” between the web server. This typically happens when a browser connects to a web server and the browser issues a “bad request” to the connection. The server seems to have issued a 405 error. This means that the http request (or method) was not handled or is unknown.

Here is a [link][1] that may help you resolve the 405 error that was thrown.

I spoke with our HTML5 Developer directly about the issue that you had ran into. Here is a library that he has personally used in the past which may correct the handshake issue you’ve ran into as well. There may be some tweaking you may need to do, based on your project specifically or updated in general.

[Handshake.c][2]
[Server-Handshake.c][3]

Troubleshoot Web API2 apps that work in Visual Studio and fail on a production IIS server | Microsoft Learn
[2]: https://github.com/warmcat/libwebsockets/blob/master/lib/handshake.c#L108
[3]: https://github.com/warmcat/libwebsockets/blob/master/lib/server-handshake.c#L159

Dear ,

Thank you for responding, and thank you for contacting the UE4 HTML developer!

I appreciate your info, but something is confusing me.

How come I get a crash even when opening two pre-packaged versions of the game and connecting via 127.0.0.1, which works great if I dont use the HTML plugin?

“Just open two instance of the game, not even involving packaging the game, use open ?listen to make one a listen server, try to join with other via 127.0.0.1, get crash as shown below”

To clarify, here’s what I am adding in the DefaultEngine.ini

;~~~ Game Engine ~~~
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/HTML5Networking.WebSocketNetDriver",DriverClassNameFallback="/Script/HTML5Networking.IpNetDriver")

Connecting two pre-packaged games using 127.0.0.1 crashes with this config setup.

I"ve verified that the HTML5Networking driver is indeed being used :slight_smile:

,

Are you getting the same exact crash, after looking into the information provided previously? Or are you receiving a new crash after you’ve made any necessary changes?

Hey ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you!

I think there might be some confusion about the test case I am trying:

Just open two instance of the game, not even involving packaging the game, use open ?listen to make one a listen server, try to join with other vai 127.0.0.1, get crash as shown below

There’s no actual webserver involved here, just two instances of the Editor-build, using the HTML5Networking plugin.

The crash I am getting is easy to reproduce:

  • Make a new third person template project
  • Change config file to use HTML5Networking network driver, sample of what I am doing is posted above in this thread
  • run 1 instance of this game as a listen server via open ?listen
  • try to have a second instance of this game join via open 127.0.0.1
  • This crashes for me :slight_smile:

there’s no packaged game or webserver or deployed version involved in this crash that I am reporting, admittedly a subset of my original post

If you’d like this extracted as a separate report just let me know!

I was hoping to resolve this crash before trying the webserver code because the issue might be easier to resolve if it is related to this 127.0.0.1 editor build crash that I am reporting.

Thanks !

#:heart:

I have replied above, happy holidays!

, I just ran through the steps that you provided. I did not receive a crash. I updated my engine.ini as well for the project. Both of my games updated appropriately with the usable third person character inside.

Have you tried this on a new project to see if it was simply the project you originally had worked with?

,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you!

Hi there!

I will test again in 4.11, I imagine there’s been lots of work on HTML5 OS for 4.11, so I think a fresh look then will be most productive.

Thank you for taking the time to address my answerhub posts !

:slight_smile: