Re: Apple modern client/server paradigm
site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=O0TxA5ENqpXqxmo4TC93TJDvQBbp2 uFl7O9jYLixhx8=; b=dVA9RdaFPOJJAbgWdxxHzGAEUFg4bbamr7q7ylTo87bOM ZEema2htLu3rrZkhTMf6oH/z6JOuTbXiw2RCIBS/bzUFnypZLnl7HjeMEUs72kty NWTpDGAXngWBvk11fePoNVFw4IFEWB1q5b3V6wRBg96qibgjEmulUnR4KFWpjhHq OlWquKuO9+O1Upu/r+hccB8AYh87C6eXVsMyu2p+d5Hl7NIk0obtik17n+yuxjJD YhB7Dg6y3eo8vTvqxCKfXnj1Zu0Qi2hdYdEha7OPyFuesx7Gox+BLJ5BKQQauA9X x0UuluANBgqj/3z02RXKy5fIF54szWosx+Awd/MvA==
On Aug 3, 2018, at 4:37 PM, Carl Hoefs <newslists@autonomy.caltech.edu> wrote:
- Does one use Apache on macOS and place binaries into CGI-Executables? Or use something like CocoaHTTPServer to create a custom server? Or...?
I don't think Apache is even present anymore; there's no "Web Sharing" checkbox in the Sharing system pref. Building a server component is nontrivial, unfortunately. The actual socket part is pretty easy if you use NSNetService and publish your service with the NSNetServiceListenForConnections option — you just have to add a delegate method that will be called with an NSStream input/output pair when a client connects. But once you've got the socket streams, the OS doesn't help you with implementing any protocols. Implementing a real working HTTP server is pretty hard, but it's probably a lot easier to implement a dumbass one that just responds to one request and closes the socket (i.e. HTTP/0.9.) You can use CFHTTPMessage to do the header parsing/generation.
- On the iOS side, does one need only use NSURLConnection and friends? Or...?
It's NSURLSession these days. —Jens _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jens Alfke