In point #4, try<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "> socket = new WebSocket("wss://localhost:</span><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">8080/</span><b style="background-color: rgb(255, 255, 0);">websocket</b><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">");</span></span><br>
<br>Also note that the SSL connection will be made directly from the browser to the netty websocket server.</div><div><br></div><div>Are you planning to proxy the ssl connection via Apache? </div><div><br></div><div>If Yes, then you will have to adjust your web socket port to that of the proxy (note that I've not tried this out and don't know if it will work or not).</div>
<div><br></div><div>If No, then you will have to install SSL in your netty websocket server. I've not tried this out but I don't think it should be too different from SecureChat server example.</div><div><br></div>
<div>I would recommend trying to get it working without SSL first and then adding SSL later. Without SSL, don't forget to change wss back to ws.</div><div><br></div><div><span class="Apple-style-span" style="font-size: 13px; font-family: arial, sans-serif; background-color: rgb(255, 255, 255); "> socket = new WebSocket("ws://localhost:</span><span class="Apple-style-span" style="font-size: 13px; font-family: arial, sans-serif; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">8080/</span><b style="background-color: rgb(255, 255, 0); ">websocket</b><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">");</span></span></div>
<div><br>Regards</div><div>Vibul</div><div><br></div><div><br><div class="gmail_quote">On 31 October 2011 20:36, Tamirk <span dir="ltr"><<a href="mailto:tamirklein@hotmail.com">tamirklein@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
Sure here goes:<br>
<br>
1) I installed local certificate on my Apache server using openssl<br>
(<a href="http://slacksite.com/apache/certificate.php" target="_blank">http://slacksite.com/apache/certificate.php</a>)<br>
<br>
2) I modified WebSocketServerHandler.getWebSocketLocation to the following:<br>
private String getWebSocketLocation(HttpRequest req) {<br>
return "wss://" + req.getHeader(HttpHeaders.Names.HOST) + WEBSOCKET_PATH;<br>
}<br>
3) I copy paste the code in WebSocketServerIndexPage to testNettyWS.html and<br>
put it under my web root directory<br>
4) I modified the socket init code to the following:<br>
socket = new WebSocket("wss://localhost:8080/");<br>
5) I run the WebSockerServer and bind port 8080<br>
6) I now browse to <a href="https://localhost/testNettyWS.html" target="_blank">https://localhost/testNettyWS.html</a> and I get the below<br>
error<br>
<br>
Oct 31, 2011 11:28:43 AM<br>
org.jboss.netty.example.http.websocketx.server.WebSocketServerHandler<br>
FINE: Channel 792386646 is open<br>
java.lang.IllegalArgumentException: empty text<br>
at<br>
org.jboss.netty.handler.codec.http.HttpVersion.<init>(HttpVersion.java:95)<br>
at<br>
org.jboss.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:68)<br>
at<br>
org.jboss.netty.handler.codec.http.HttpRequestDecoder.createMessage(HttpRequestDecoder.java:81)<br>
at<br>
org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:198)<br>
at<br>
org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:107)<br>
at<br>
org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:470)<br>
at<br>
org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:443)<br>
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:275)<br>
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:262)<br>
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:340)<br>
at<br>
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:271)<br>
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:191)<br>
at<br>
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br>
at<br>
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>
at java.lang.Thread.run(Thread.java:662)<br>
java.lang.IllegalArgumentException: invalid version format: ?_?_?__<br>
<br>
Note: I also tried to connect to the SecureChatServerExample found in the<br>
example folder but I got similar error.<br>
<br>
Please let me know if this is clear enough to troubleshoot.<br>
<br>
If my approach is wrong and I need to set this up in a different way please<br>
let me know.<br>
<br>
Cheers,<br>
<br>
Tamir<br>
<a href="http://netty-forums-and-mailing-lists.685743.n2.nabble.com/file/n6947532/testNettyWS.html" target="_blank">http://netty-forums-and-mailing-lists.685743.n2.nabble.com/file/n6947532/testNettyWS.html</a><br>
testNettyWS.html<br>
<a href="http://netty-forums-and-mailing-lists.685743.n2.nabble.com/file/n6947532/WebSocketServerHandler.java" target="_blank">http://netty-forums-and-mailing-lists.685743.n2.nabble.com/file/n6947532/WebSocketServerHandler.java</a><br>
WebSocketServerHandler.java<br>
<div class="im">Hi,<br>
<br>
No problems. Please outline:<br>
<br>
1. What you are trying to do?<br>
<br>
If you are running the server sample in<br>
org.jboss.netty.example.http.websocketx.server.WebSocketServer, you should<br>
be able to point your browser to <a href="http://localhost:8080" target="_blank">http://localhost:8080</a>.<br>
<br>
2. What errors are you getting? Can you post a bit more code so we can get<br>
some context.<br>
<br>
<br>
Regards<br>
Vibul<br>
<br>
</div><div><div></div><div class="h5">On 31 October 2011 18:35, Tamirk <tamirklein@> wrote:<br>
<br>
> Hi Vibul,<br>
><br>
> Yes I'm using this example and it's working great!!!<br>
><br>
> // Handshake<br>
> WebSocketServerHandshakerFactory wsFactory = new<br>
> WebSocketServerHandshakerFactory(<br>
> this.getWebSocketLocation(req), null, false);<br>
> this.handshaker = wsFactory.newHandshaker(ctx, req);<br>
> if (this.handshaker == null) {<br>
> wsFactory.sendUnsupportedWebSocketVersionResponse(ctx);<br>
> } else {<br>
> this.handshaker.executeOpeningHandshake(ctx, req);<br>
> }<br>
> return;<br>
><br>
><br>
> My problem is when I try to connect to wss://localhost:8080/websocket I<br>
> failed to get a connection.<br>
><br>
> I tried several approaches but nothing is working out of the box :(<br>
><br>
> Can you direct me how to resolve this.<br>
><br>
> Cheers,<br>
><br>
> Tamir<br>
><br>
> --<br>
> View this message in context:<br>
> <a href="http://netty-forums-and-mailing-lists.685743.n2.nabble.com/WSS-with-Draft10-Support-tp6945374p6947226.html" target="_blank">http://netty-forums-and-mailing-lists.685743.n2.nabble.com/WSS-with-Draft10-Support-tp6945374p6947226.html</a><br>
> Sent from the Netty User Group mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> netty-users mailing list<br>
</div></div>> netty-users@.jboss<br>
> <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
><br>
<br>
_______________________________________________<br>
netty-users mailing list<br>
netty-users@.jboss<br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<font color="#888888"><br>
<br>
<br>
--<br>
View this message in context: <a href="http://netty-forums-and-mailing-lists.685743.n2.nabble.com/WSS-with-Draft10-Support-tp6945374p6947532.html" target="_blank">http://netty-forums-and-mailing-lists.685743.n2.nabble.com/WSS-with-Draft10-Support-tp6945374p6947532.html</a><br>
</font><div><div></div><div class="h5">Sent from the Netty User Group mailing list archive at Nabble.com.<br>
_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
</div></div></blockquote></div><br></div>