I've been working on an online socket server using NodeJS and javascript, and I've been creating "playrooms" in my code using require:
new_game_obj = require('./forza4.js');
Now.. this works find when I test my code on my local machine, but for the production server I've been presented with a problem. It would seem that for some technical reason, the process that runs my code is on a different machine then the one I have access to (for file uploading, and such), so I was asked by the guys on the server farm to change my code so that I will load the code I have in "forza4.js" from a global position, and not local, like I do at the moment. So I changed the code to this:
new_game_obj = require('http://www.xxxxx.com/blabla/forza4.js');
(Of course I tested to see if the file is there, just to be sure, it shows in the browser when I point to that actual address) But I get an error from my code (again, at this point, I'm running this locally on my machine), which says:
Exception: Error: Cannot find module 'http://www.xxxxx.com/blabla/forza4.js'
So just to be on the safe side, I did:
new_game_obj = require('http://92.xx.xx.xx/blabla/forza4.js');
But again, the same error.
Should there be a problem loading an "extension" to my code from a remote server, or am I just formatting the "require" call wrong?
Thanks a bunch!
Yuval.
P.S. This is a follow up to this thread: This is the older and resolved post