Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Migration from Flash to Javascript

$
0
0
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.

Viewing all articles
Browse latest Browse all 15755

Latest Images

Trending Articles



Latest Images