Re: I need some feedback
Re: I need some feedback
- Subject: Re: I need some feedback
- From: Adam Kaplan <email@hidden>
- Date: Mon, 21 Jan 2019 13:58:38 -0800
Having also implemented WebSockets to spec in the past, I agree that people
shouldn’t be doing that. Too many edge cases to handle, like a single UTF-16
character split across frames and other madness.
Luckily there are some great WebSocket projects like Starscream (
https://github.com/daltoniam/Starscream ); and if you cannot use Swift, it’s
crusty older brother Jetfire.
For the app that will act as the "server", the Swifter project
https://github.com/httpswift/swifter provides both an HTTP/1 and WebSockets
interface. Disclaimer: I have only used Swifter for unit testing the WebSocket
client in Yahoo Finance, but it should be fine for production as well.
All of this supports TLS and SSL Pinning, so you shouldn’t need to worry about
encryption at the wire level.
Another option for transferring many large files is to run an HTTP/2 server.
The “client” side can then leverage NSURLSession’s HTTP/2 support to naively
blast multiple files efficiently over a single multiplexing TCP connection. I
don’t know an iOS HTTP/2 server package off-hand, but certainly they are out
there.
-adam
On Mon, Jan 21, 2019 at 1:10 PM Jens Alfke < Jens Alfke ( Jens Alfke
<email@hidden> ) > wrote:
>
>
>
>
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Macnetworkprog mailing list ( email@hidden )
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>>
>>
>>
>
>
> On Jan 18, 2019, at 3:58 PM, Josh Graessley < email@hidden > wrote:
>
>
> There is an implication here that a WebSocket API would support both a
> client and a server.
>
Yes, server-side support would be very valuable for P2P use cases.
>
> Does your radar explicitly ask for client and server? Do you happen to
> have the radar number handy?
>
Drat, it appears I didn’t actually get around to filing this, since I can’t
find it in the BugReporter website. :(
I’ve just filed a request as rdar://47430997.
>
> WebSockets will provide framing, which can make some things easier but it
> won’t help with TLS, especially when it comes to each side validating the
> identity of the peer.
>
If it’s layered on NSURLSession, then TLS is mostly taken care of on the client
side. The server implementation would hopefully implement its side of the TLS
handshake too.
For P2P use there are of course difficulties in establishing trust, but having
the protocol layer taken care of would still be a big step up for developers.
—Jens (who has had to implement WebSocket on iOS/Mac 3 times now and doesn’t
want to do it again)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden