How to refer ajax calls to cloud9 server?


#1

Created a node.js https server with createServer, listening on port 8080.

I’m trying to make an .ajax call from javascript/jquery hosted within the same workspace. I’m not worried about the API being accessible from the outside my application (its just for testing).

What should I use for the .ajax URL string?

I’ve tried https://workspace.username.c9users.io:8080/ but I keep on getting the following browser console error:

GET (URL here) net::ERR_INSECURE_RESPONSE.

I think its something to do with c9’s utilisation of https because when I switch to using http.createServer and change the preview URL to use http, I can reach the server. But the preview URL switches back to https on every refresh, so its hardly ideal (which seems to be a browser/c9 thing, I’ve disabled https everywhere, so it’s not on my side).


#2

No, HTTPS is fully supported for one level of subdomains. Your problem is that you need to use https://workspace-username.c9users.io:8080, with a dash, not a dot between workspace and username.