After some painstaking debugging, I found out what was wrong with my setup. I can also share my findings, although they (I think) are not related to Node.js, Socket.IO or Apache.
As I mentioned, my question had simplified code to show you my installation without interference. However, I configured the client through the object, using properties to configure the socket connection. For instance:
var MyProject = {}; MyProject.Uploader = { location: 'my.server:8080', socket: io.connect(location, { secure: true, port: 8080, query: "token=blabla" }), // ...lots of extra properties and methods }
The problem was using location as the property name. This is a reserved word in Javascript and causes some strange behavior in this case. It was strange to me that the property name of an object cannot be a reserved word, so I decided to check. I also noticed that the property was referenced incorrectly, I forgot to use this.location when connecting to the socket. So I changed it to this as a test.
var MyProject = {}; MyProject.Uploader = { location: 'my.server:8080', socket: io.connect(this.location, { secure: true, port: 8080, query: "token=blabla" }), // ...lots of extra properties and methods }
But to no avail. I still have not received socket data. So, the next step seemed logical in my desperate desperate rage. Changing the property name fixed everything!
var MyProject = {}; MyProject.Uploader = { socketLocation: 'my.server:8080', socket: io.connect(this.socketLocation, { secure: true, port: 8080, query: "token=blabla" }), // ...lots of extra properties and methods }
This approach worked fine, I got a lot of debugging messages. SUCCESS!! Whether the behavior in Javascript is expected to be reversed (or something there that happens here is βmisusedβ, seems to be the best way to pass it to me right now) of the object's properties, if you use a reserved word, I don't know. I only know that now I get rid of them!
Hope this helps anyone!