Author Topic: Web Sockets  (Read 2156 times)

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Web Sockets
« on: April 07, 2023, 08:28:25 pm »
Does anyone know if its possible to create a Web Socket in EA's javascript engine or even a basic network socket?

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1324
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Web Sockets
« Reply #1 on: April 08, 2023, 04:28:39 pm »
The Javascript Engine is Spidermonkey v63.
Yes in theory, it should be possible to create a Web Socket in Sparx EA JavaScript engine.
Here is an example of how to use websocket with javascript you could try.
https://www.dev2qa.com/how-to-use-websocket-in-javascript-with-examples/#:~:text=How%20To%20Use%20WebSocket%20In%20Javascript%20With%20Examples,2.%20How%20To%20Use%20WebSocket%20In%20JavaScript%20Example.
« Last Edit: April 08, 2023, 04:39:41 pm by Sunshine »
Happy to help
:)

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Web Sockets
« Reply #2 on: April 08, 2023, 09:04:41 pm »
Thanks for the response however, new WebSocket does not work, it appears that this library has not been included or the version of Spider Monkey is too old. I did look for a COM/ActiveX version but this is messy and a security flaw. I cannot use V8 require or module imports so there seems no way to invoke a web socket which is a shame.

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Web Sockets
« Reply #3 on: April 11, 2023, 06:32:18 pm »
Ignore this post, I have solved my issue.