Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On device iOS websocket server

Tags:

ios

websocket

Looking to implement websockets communication between a UIWebView in iOS with javascript to a local on the device websockets server in objective-c. Anyone seen a sample code set for setting a local websocket server on device for iOS so that the web view half can easily talk to the native container and vice versa?

like image 658
tekgeek Avatar asked Aug 08 '12 22:08

tekgeek


People also ask

Do WebSockets work on iOS?

As you can see from the code snippets above, although the communication is done over WebSockets, the underlying WebSocket protocol is ''hidden'' from developers. You can decide to use any WebSocket-based protocol that supports iOS.

How do I deploy a WebSocket server?

After creating your WebSocket API, you must deploy it to make it available for your users to invoke. To deploy an API, you create an API deployment and associate it with a stage. Each stage is a snapshot of the API and is made available for client apps to call.

Is WebSocket better than socket IO?

Both WebSocket vs Socket.io are popular choices in the market; let us discuss some of the major Difference Between WebSocket vs Socket.io: It provides the Connection over TCP, while Socket.io is a library to abstract the WebSocket connections. WebSocket doesn't have fallback options, while Socket.io supports fallback.

Is WebSocket heavy on server?

One HTTP request and response took a total of 282 bytes while the request and response websocket frames weighed in at a total of 54 bytes (31 bytes for the request message and 24 bytes for the response). This difference will be less significant for larger payloads however since the HTTP header size doesn't change.


1 Answers

I have made a websocket server that runs on iOS. It is a wrapper around libwebsockets, the code is on github: https://github.com/benlodotcom/BLWebSocketsServer .

like image 74
benlodotcom Avatar answered Oct 10 '22 19:10

benlodotcom