Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I Make a Web Server in 15 Minutes?



At 12:29 pm -0800 20/2/2008, Jerry Krinock wrote:
My Macintosh application makes HTTP requests from third-party servers that are beyond my control. So, I've designed in lots of error recovery, but in order to test it I need to simulate poor responses. For example, to test my timeout algorithms I need to simulate a long-delayed server response.

It seems a good solution would be to set up a dumb little web server on my Mac, or another Mac on the network, and have my app send requests to it. I know lots of perl and found this tutorial entitled "CGI Programming with Apache and Perl on Mac OS X":

http://www.cgi101.com/learn/connect/mac.html

Before embarking down this path, I was wondering if someone could confirm that this is the correct (easiest) way to go. The link above seems to date back to Jaguar. Is there a more recent resource I should read instead?

If you just want something that will spit out a canned response when your client connects to it, there are lots of approaches, what is easiest will depend on what you are most familiar with. If you like writing shell scripts, you could use the nc command with a shell script, check out the man page for nc. If you would find it easier to do something in C, grab the code I posted a couple of weeks ago on accept() and setsockopt() and add in recv, sleep, and send calls.


Glenn.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden
References: 
 >Can I Make a Web Server in 15 Minutes? (From: Jerry Krinock <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.