1 function get_host_info() {
2 var ORIGINAL_HOST = '127.0.0.1';
3 var REMOTE_HOST = 'localhost';
4 var UNAUTHENTICATED_HOST = 'example.test';
8 // In W3C test, we can get the hostname and port number in config.json
9 // using wptserve's built-in pipe.
10 // http://wptserve.readthedocs.org/en/latest/pipes.html#built-in-pipes
11 HTTP_PORT = eval('{{ports[http][0]}}');
12 HTTPS_PORT = eval('{{ports[https][0]}}');
13 ORIGINAL_HOST = eval('\'{{host}}\'');
14 REMOTE_HOST = 'www1.' + ORIGINAL_HOST;
18 HTTP_ORIGIN: 'http://' + ORIGINAL_HOST + ':' + HTTP_PORT,
19 HTTPS_ORIGIN: 'https://' + ORIGINAL_HOST + ':' + HTTPS_PORT,
20 HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + ':' + HTTP_PORT,
21 HTTPS_REMOTE_ORIGIN: 'https://' + REMOTE_HOST + ':' + HTTPS_PORT,
22 UNAUTHENTICATED_ORIGIN: 'http://' + UNAUTHENTICATED_HOST + ':' + HTTP_PORT