Joined December 2012
·

Boopathi Rajaa

User Interface Engineer at Integriti
·
Bangalore
·
·
·

Posted to Socket.io and OpenShift Websockets over 1 year ago

https://www.openshift.com/blogs/paas-websockets
It seems, we have to use the port "8000" and "8443" for websockets.
I've been trying to change this on the client using

//server
io = require('socket.io').listen(8000);
//client
var socket = io.connect("http://something:8000");

But request keeps going to port 80 ... Is there any work around for this ?

@dpashkevich The point of this post is "Prototypes can't talk to local variables in constructor".

this.count = 0;

is a pretty good method to follow, but the stress is, when we distribute the code to beginners, some might end up writing code that messes up the sensitive information simply by extending the code via prototypes (or) directly modifying count in this case. So we might want to simulate a model where we can use something as private variables. (stressing - by private, I don't mean typical class System as in other languages.)

The point again, is just, if we write JS code assuming that to represent a class (simulating it), then, there is a bottleneck of not accessing some variables - destined to contain secure information that should be modified based on some function alone and should not be accessed directly.

Achievements
348 Karma
24,627 Total ProTip Views