I've been researching for many hours, but haven't found a definite answer. Is it possible for a client to connect to a hidden service with websocket? If so, how can I learn more? If not, is there an alternative that will allow socket communication besides http from a client to a Tor hidden service?
This may be useful as an example: http://chattorci7bcgygp.onion/
As someone who has used web sockets for their hidden service, it is definitely possible. Here are a few pieces of advice:
- Use NGINX over Apache. The proxy module for NGINX is mush faster than Apache's. When you add the potential slowness that comes with using tor, timeouts may become a reality.
- Make sure that the web socket has a plan for unicode. People will try speaking in Russian, Korean, Arabic, etc. If your web socket isn't expecting unicode, it may crash.
Other than that, web sockets over tor are no different from hosting a web socket on the clearnet.