title: Wrong url scheme for WebSocket
body: <p>I have a websockets program in play 2.1, which works just fine and the template looks like this:</p>
  
  <pre><code>// Contents of the view.scala.html file
  @(userName: String)(implicit request: RequestHeader)
  
  @main("text") {
    &lt;script type="text/javascript" charset="utf-8"&gt;
    $(function() {
      var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket;
      alert("before")
      var socket = new WS("@routes.Application.view(userName).webSocketURL()");
      alert("after")
      socket.onmessage = function(event) {
        alert(event.data);
      };
    });
    &lt;/script&gt;
  }
  </code></pre>
  
  <p>The issue is that as soon as I move my javascript into the <code>assets.javascripts</code> folder and change the <code>view.scala.html</code> file into the following it stops working.</p>
  
  <pre><code>// Contents of the view.scala.html file
  @(userName: String)(implicit request: RequestHeader)
  
  @main("text") {
    &lt;script type="text/javascript" charset="utf-8"
            src="@routes.Assets.at("javascripts/viewer.min.js")"&gt;&lt;/script&gt;
  }
  </code></pre>
  
  <p>Play finds the file, executes the javascript, I can see the popup triggered by the <code>alert("before")</code> line of code, but after that... nothing.</p>
  
  <p>This is the google chrome error I get in the console:</p>
  
  <pre><code>Wrong url scheme for WebSocket
  http://localhost:9000/@routes.Application.view(userName).webSocketURL()
  </code></pre>
  
  <p>What am I missing?</p>