Skip to content

Comment on Square Releases Open Source WebSocket Client for Objective-C

Comments

Is there any reason to use WebSockets on native apps other than if you want to share one server between native and web?

Only reason I can think of is to traverse firewalls that block outbound sockets but don't block HTTP+WebSocket.

That aside, it seems a bit ridiculous, given that we already have sockets, to bolt on a protocol that exists almost solely to work around security issues involved in a browser opening a socket.

I think it's the same reason you would want to use good old HTTP over raw sockets for a request/response API, even though with a native client you could just invent your own protocol.

If you want bidirectional communication to your app, it's much easier to make a server that uses the WebSocket Protocol (tornado, etc.) instead of rolling your own server and protocol.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.