How to websocket over ssl

358 views
Skip to first unread message

Michael Fung

unread,
Nov 27, 2012, 12:46:09 AM11/27/12
to mojol...@googlegroups.com
Dear all

I used the code sample here:
https://github.com/kraih/mojo/wiki/Writing-websocket-chat-using-Mojolicious-Lite

It works.

But but when I change to https with:
morbo -v -l "https://*:3000/" wsserver.pl

It doesn't work. Of course, the form is shown as expected, but the textarea stays empty.

Any ideas?

Rgds,
Michael

Michael Fung

unread,
Nov 27, 2012, 10:16:06 PM11/27/12
to mojol...@googlegroups.com

Just in case someone is interested, I attached a dump of the traffic while using HTTP mode.

michael brandeis

unread,
Nov 28, 2012, 12:06:29 PM11/28/12
to mojol...@googlegroups.com
Using https:// will block http:// content. You might try changing the jquery reference, and any other resources you need, to use https://

Michael Fung

unread,
Nov 28, 2012, 10:35:51 PM11/28/12
to mojol...@googlegroups.com
Thanks, that helped!

However, also need to modify the uri to:
var ws = new WebSocket('wss://127.0.0.1:3000/echo');

And upgrade jQuery to:
src="http://code.jquery.com/jquery-1.7.2.min.js"


Rgds,
Michael
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mojolicious/-/aCK4J9osQjwJ.
To post to this group, send email to mojol...@googlegroups.com.
To unsubscribe from this group, send email to mojolicious...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mojolicious?hl=en.

Reply all
Reply to author
Forward
0 new messages