Migration from Flash to Javascript

edited May 2015 in JavaScript
Hey! I have online flash game, that uses Flash on client side. I want switch to JavaScript, but have questions about JS Photon libarary:

Seems like Flash socket and WebSocket is not the same thing? Am I right?
Do I need to ask our server side programmer to make changes on server, to support websockets?

In Flash I had:
const SERVER_URL:String = "127.0.0.1";
const PORT:int = 9090;
const POLICY_PORT:int = 843;

var peer:PhotonPeer = new PhotonPeer();
peer.initializeConnection(SERVER_URL, PORT, POLICY_PORT);

so I tried to repeat same code in js:
var peer = new Photon.PhotonPeer('ws://127.0.0.1:9090");
WebSocket connection to 'ws://127.0.0.1:9090' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
Photon-Javascript_SDK.js:721 'WebSocket.URL' is deprecated. Please use 'WebSocket.url' instead.

Comments

  • vadimvadim ✭✭✭
    Yes, they are different things (but flash client might fall back on websockets if flash plugin is not available).
    You need to setup websocket listener on server ports 9090-9092 (or 19090-19092 for secure websockets) if you still did not do so.
    Latest Photon Server available for download should have these listener set up in configs.
  • I am having ERR_CONNECTION_RESET problem in my PC.
  • vadimvadim ✭✭✭
    Please describe what you do and provide error details.
Sign In or Register to comment.