简体   繁体   中英

Communicating between Java SSLSocket and HTML5

Just a quick question, can I use SSL in html5 with websockets to communicate with my java server that is using SSLSockets?

I have been trying to connect using another java client using ssl sockets, which works, but I have not tried to do it through html5. Is it even possible?

For the record, I am using github pages to host my server, and I have a custom domain provided by Namecheap and an SSL certificate from Comodo.

Is it even possible to communicate between java and html5 using SSL?

WebSockets are not the same as "normal" TCP sockets but instead a protocol layer on top of TCP. And thus WebSockets over SSL can not communicate directly with SSLSockets. To communicate with WebSockets (with or without SSL) you would need a library implementing the WebSocket protocol .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM