Fixed relative URL to sockjs endpoint, wasn't yet using the proper base url
Generated URLs now take X-Forwarded-Host header sent by proxies into account for included host and port
Don't user server.host but server.forwardedHost as fallback for generated external URLs

Closes #698
Merge branch 'master' into devel

Conflicts:
	src/octoprint/server/util.py
	src/octoprint/settings.py
	src/octoprint/templates/index.jinja2