Socket.io How to make function io() anonymous?
<p>I'm trying to make an application on node.js using Soket.io</p>

<h2>server-side</h2>

<pre><code>var server = http.createServer(app);
var io = require('socket.io')(server, {httpCompression: false, cookie: false});
io.on('connection', function(socket) { ... });
</code></pre>

<h2>client-side</h2>

<pre><code>&lt;script src="https://cdn.socket.io/socket.io-1.4.5.js"&gt;&lt;/script&gt;
&lt;script&gt;
    var socket = io('ws://my-ws-server:8000/');
&lt;/script&gt;
</code></pre>

<p>My problem:
Each client/user can write into console <code>mysocket=io('ws://my-ws-server');</code> and push new connection, so now he can <code>emit</code> signals with wrong data or spam with new Socket connections</p>

<p>I also tried download socket.io.js code, edit it with <code>$(function(){ /*socket.io code*/ });</code>, and when <code>include ../javascript/socket.io.js</code> to my page, but it doesn't help, io() function still accessed from console</p>

<p>so, is there any solution? Is here any way to hide this function and prepare from spam with new fake socket connections?</p>

<p>tnx, sry for my eng.</p>