Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

local file not loading dependencies #155

Closed
brihogan opened this Issue Nov 23, 2011 · 2 comments

Comments

Projects
None yet
3 participants

This must be because I'm using a local HTML file that connects to a node server, but it wasn't loading the socket.io/socket.io.js file. Turns out it was looking for file://localhost:port/socket.io/socket.io.js while it should have been looking for http://. It appears to actually look for //localhost:port/xxxxx and Chrome just figures it must be file: since I'm using a local html file.

I changed line 592 under now.js to include the http: string, but am not sure if this is safe. It seems to work for now.

fileref.setAttribute('src', 'http:' + uri + dependencies[i]['path']);

Obviously this would break if someone were using https. Maybe there ought to be an overriding constant or something? I realize this would mean someone would have to run an initializing function or something, but this would only be for the rare case someone uses a local file (like myself) - or maybe has an http file that communicates over https?

Anyway, brilliant framework!

Contributor

steveWang commented Dec 30, 2011

You could always set autoHost to false and add the line var now = nowInitialize('http://localhost:port'); to your client-side code.

Contributor

ericz commented Jan 16, 2012

Closing. Feel free to reopen if there are additional issues.

@ericz ericz closed this Jan 16, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment