<div dir="ltr">Dear folks<div><br></div><div>It's quite easy to add a wss=>ws proxy. Here's how:</div><div><br></div><div>1. Assume you already have a working HTTPS website on nginx.</div><div><br></div><div>2. Edit /etc/nginx/sites-enabled/https-site</div><div>Put the following at the top of this file:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>map $http_upgrade $connection_upgrade {</div></div><div><div>  default upgrade;</div></div><div><div>  '' close;</div></div><div><div>}</div></div></blockquote><div>Put the following inside 'server' section:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>  location /NFD {</div></div><div><div>    proxy_pass http://[2001:db8::1]:9696;</div></div><div><div>    proxy_http_version 1.1;</div></div><div><div>    proxy_set_header Upgrade $http_upgrade;</div></div><div><div>    proxy_set_header Connection "Upgrade";</div></div><div><div>  }</div></div></blockquote><div>Substitute 2001:db9::1 with the IP address of NFD. I only tested IPv6.</div><div><br></div><div>3. Edit ndn.js:</div><div>Look for 'new WebSocket', and change the parameter into:</div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>connectionInfo.wsuri || ('ws://' + connectionInfo.host + ':' + connectionInfo.port)<br></div></blockquote></div><div><br></div><div>4. Edit web app:</div><div>Change "new Face({ host:'<a href="http://nfd.example.com">nfd.example.com</a>', port:9696 })" to "new Face({ wsuri:'wss://<a href="http://secure.example.com/NFD">secure.example.com/NFD</a>' })".</div><div><br></div><div>Yours, Junxiao<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 23, 2015 at 1:46 PM, Junxiao Shi <span dir="ltr"><<a href="mailto:shijunxiao@email.arizona.edu" target="_blank">shijunxiao@email.arizona.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p dir="ltr">Hi Jeff</p>
<p dir="ltr">An alternate to NFD serving wss directly is to add a frontend TLS=>TCP/HTTP proxy, such as STunnel or nginx.<br>
But I'm not sure how to configure those.</p>
<p dir="ltr">Yours, Junxiao</p></blockquote></div></div></div></div>