Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't connect and getting a "unhandled socket.io url" error with MAMP + Socket.io (node.js)
    primarykey
    data
    text
    <p>I'm developing an application using CodeIgniter on a MAMP server (for development, live it'll be on LAMP). I'm trying to add the real-time functionality of socket.io for a chat server, but I'm having some issues. I have socket.io and MAMP up and running independently, but I can't get my client to talk to my server.</p> <p>server.js:</p> <pre><code>// Get the Socket.io module var io = require('socket.io'); console.log ( 'Chat Server started' ); // Create a Socket.IO instance, listen on 8084 var socket = io.listen(8084); // Add a connect listener socket.on('connection', function(client){ console.log ( "Server Connected" ); }); </code></pre> <p>My client script (the socket.io.js loads fine and my console says "debug: served static content" whenever I load the page):</p> <pre><code>&lt;script src="http://localhost:8084/socket.io/socket.io.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; // Create SocketIO instance, connect var socket = new io.Socket('localhost',{ port: 8084 }); socket.connect(); socket.on ( 'connect', function () { console.log ( 'Client connected' ); } ); &lt;/script&gt; </code></pre> <p>After starting the node.js file, I get this in my console:</p> <pre><code>Chat Server started info - socket.io started </code></pre> <p>After loading the client (directing my browser to <a href="http://localhost:8888" rel="nofollow">http://localhost:8888</a> - the default port for MAMP), I don't get any of the console messages, but instead a steady stream of this (about every second):</p> <pre><code>info - unhandled socket.io url </code></pre> <p>It looks like it's not connecting at all. Also, no errors in my JS error console on the browser. Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload