I cannot play my unity3d game files (mime type="application/vnd.unity") over a Node.js connection. (I am able to play the unity3d through the Apache Vhosts Access.)
I just started a new instance of a Node.js app server to begin development of server side game components.
I have a basic server.js:
var http = require('http'),
fs = require('fs');
fs.readFile("./unityBase.html", function (err, html) {
if (err) {
throw err;
}
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/html"});
response.write(html);
response.end();
}).listen(8080);
});
And a simple unityBase.html:
Unity Web Player | StarFluke
(I stripped out a Style block for you to see the code easier.)
As I mentioned earlier, the unityBase.html runs fine in Apache Vhost Access; it does not run through a normal browser connection to www.starfluke.com or starfluke.com. It gives an error that claims the unity3d file is corrupt.
Do you have any suggestions of what I might try? Anything would be helpful, I am new at Node.js.
Oh, when testing the page make sure you have the Unity3D web player installed:
(http://unity3d.com/webplayer). I stripped out that part of the page code to try to narrow down the problem.
Thank you,
Daniel
↧