View Issue Details

IDProjectCategoryView StatusLast Update
0031370RunnerNetworkingPublic2019-10-09 15:57
ReporterScott DunbarAssigned ToRussell Kay 
PriorityMediumSeverityC - GeneralReproducibility100%
Status ResolvedResolutionFixed 
PlatformHTML5OSOS Version
Product Version2.2.4 
Target Version2.3.0Fixed in Version2.3.0 
Summary0031370: Networking: WebSocket connections are not functioning correctly with the current NodeJS release
DescriptionWebSocket connections not functioning correctly with the current (new at the time of reporting) NodeJS release. Can connect to the server, but clients are unable to transfer data.
Steps To Reproduce1. unzip attached archive
2. use nodejs to run the app (server):
  To run the Node.JS projects, first run `npm install`, for the server run `node app` - The server should attach itself to port 3000.
3. open .yyz
4. run program for html5
5. observe that network connection does not error, but that data is not being transferred
TagsNo tags attached.
1.4 Found In
2.x Runtime Found In
2.x Runtime Verified In

Activities

Scott Dunbar

2019-09-24 11:15

Adminstrator  

websockets-project.zip (20,424 bytes)

Russell Kay

2019-10-01 20:45

Manager   ~0064902

Last edited: 2019-10-01 21:18

View 2 revisions

Fixed in gitlab

Both Native (VM and YYC) and HTML5 now connect to the NodeJS server supplied in the bug with a few corrections

1. in the app.js in the 'message' function in a connection the msg is always an ArrayBuffer so needs to be handled accordingly
2. HTML5 only allows async connections so you need to use the new functions network_connect_async() and network_connect_raw_async(), they take the same parameters but are asynchronous so they return the id of the socket which can be used in the async network event to detect a connection complete message and the type is network_type_non_blocking_connect

once those changes have been made then everything works as it should

The problems were caused by

1. NodeJS server is sending a string over ws our code was expecting a Blob of data - if the server always sends Blob;s then everything works as expected
2. VM and YYC were failing as the server was refusing the connection complaining about a missing Host: entry in the header, I have added this header in and now the NodeJS is accepting the connection.

Dan

2019-10-04 16:40

Adminstrator   ~0064909

The changes to support the new NodeJS version have resulted in a couple of new functions as well as a number of fixes/changes to this functionality, so it's not a simply thing we can drop in to 2.2.4 at the moment. Accordingly, I have set this as 2.3.0 for now.