Add CGI to my own web server built in cocoa

Discussion in 'Mac Programming' started by GRMrGecko, Dec 26, 2008.

  1. GRMrGecko macrumors member

    GRMrGecko

    Joined:
    Jun 7, 2008
    Location:
    Nowhere and everywhere
    #1
    How can I add CGI to my own server? I've been searching for almost a week. I found FastCGI but I don't quite understand it. Where is the documentations on how to add support to your own server? how can I add it? please someone help me!

    Thanks for any help,
    Mr. Gecko
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    Do you mean a server you have written yourself?
     
  3. GRMrGecko thread starter macrumors member

    GRMrGecko

    Joined:
    Jun 7, 2008
    Location:
    Nowhere and everywhere
    #3
    What else could I mean when I'm writing it in the programming side.
     
  4. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    No need to be rude. Some people write very non programming related things in this forum. Best bet would be to look at the Apache source code or LightHTTP and see how one of those projects do it and then implement the same sort of thing in your own server.
     
  5. GRMrGecko thread starter macrumors member

    GRMrGecko

    Joined:
    Jun 7, 2008
    Location:
    Nowhere and everywhere
    #5
    CGI appears to just be a perl script...
    Can't I just use NSTask and make it run it and return everything that is needed to be returned, parsing out headers...?
     
  6. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    Depends on the performance of that task. CGI scripts can be written in many languages such as C, Perl, Python, Ruby etc etc. If it is particularly slow then you will want to find a better way of doing it. Looking at the Apache source code will give you a better understanding of how other projects manage it.
     

Share This Page