Slashdot Mirror


phpstack - A TCP/IP Stack and Web Server in PHP

Adam Dunkels writes "Following the trend of writing 'inappropriate' programs in the PHP scripting language, I have written a small TCP/IP stack and a web server entirely in PHP. It is extremely stripped down: the IP stack only implements the most basic functionality required for running the web server and the web server cannot handle pages larger than 1.5k. Nevertheless, the stack is able to support an unlimited number of simultaneous TCP connections and the web server has support for PHP scripting. A live demonstration server is up and running the phpstack software."

10 of 295 comments (clear)

  1. Ouch by Pikhq · · Score: 2, Interesting

    The thing has a hit counter, currently at 200. 2,000,000 anyone?

    --
    echo "rm -rf ~/* ; echo "echo "Exit" ; exit" > ~/.bashrc ; exit" > ~user/.bashrc
  2. How..? by iantri · · Score: 2, Interesting
    Err.. I don't know anything about PHP so give me the benefit of the doubt.

    Is PHP able to be run standalone?

    I thought it was parsed by a webserver module when accessed?

  3. PSHTTPD - PostScript webserver by Richard_L_James · · Score: 4, Interesting

    This php webserver reminds me of HTTPi a webserver written in 100% perl. Neither of which are that hard when you know. However Anders "Pugo" Karlsson wrote a webserver called PS HTTPD in postscript. Now that I found very impressive :)

  4. Re:That is a VERY limited system.... by Thomas+Charron · · Score: 4, Interesting

    Interesting concept..

    So, basically, you can ONLY critisize something if you managed to rip the idea and make your own..

    Ever written an OS?

    Wait. Have you ever written an automated bot to post slashdot comments? If no, then you must STFU, as you have not done it yourself..

    Shesh..

    --
    -- I'm the root of all that's evil, but you can call me cookie..
  5. Should I know about this PHP? by Latent+Heat · · Score: 2, Interesting
    Strictly talking scripting languages, I have heard about Perl being good for text rearranging but being a little heavy on the non-letter characters, I have hacked out some VB script to do stuff under Windows, and I have experimented with Python. I have even heard about Ruby being popular among OO purists.

    Is this PHP thing something I should know about? I Googled for it and it seems more proprietary than Perl or Python (didn't find a free download and docs). I have read the criticism comments that PHP is in the Visual Basic category of encouraging weak minds to tackle strong tasks.

    Is this like Visual Basic in that it is cobbled together and lacks consistency and a uniform vision, or is it just simple to use and hence invites the scorn of the stronger minds? Is there some application domain where you really need to know this? Are there better substitutes? Does it have interesting ideas of its own worth emulating?

  6. netcat anyone? by tiny69 · · Score: 2, Interesting
    $ telnet 193.10.67.151 80
    Trying 193.10.67.151...
    Connected to 193.10.67.151.
    Escape character is '^]'.

    HTTP/1.0 200 OK
    Content-type: text/html
    Server: phpstack 1.0 (http://www.sics.se/~adam/phpstack/)

    [html]
    [h ead][title]The phpstack demo server[/title][/head]
    [link rel="stylesheet" type="text/css" href="http://193.10.67.151:8080/style.css"]
    [body ]
    . . .
    . . .
    All I did was hit 'enter' after the connection was established without typing in the GET command. He could have saved some time and used netcat.
    --
    Go not unto/. for advice, for you will be told both yea and nay (but have nothing to do with the question)
  7. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 2, Interesting

    I'm sure you can write a TCP/IP stack in a turing machine, but why bother it's only vain attempts at glorifying a language which was perfectly fine in the area it was designed for.

    This is the kinda stuff programmers do all the time when they are bored or playing around or trying stuff out. I'm not surprised someone did it, I'm just surprised it was considered worth telling anyone about. It's about as newsworthy as posting your homework solutions

  8. Re:Unlimited connections, really? by ultranova · · Score: 2, Interesting

    I was the visitor number 7532, and stiiilll goooiiinnggg!!!!

    Gotta admit, i'm impressed :). Even if the pictures don't ... wait, they just loaded. All of them. From a server in the middle of a slashdotting. Implemented in a scripting language.

    Now I'm impressed :).

    --

    Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  9. Re:Unlimited connections, really? by Gherald · · Score: 2, Interesting

    and I'm #11651... kinda impressive, yeah.

    But I want to see them try doing this on a weekday at about 1pm EST =)

  10. Re:That is a VERY limited system.... by sg_oneill · · Score: 2, Interesting

    I think its damn cool myself.

    So what if theres a page name being passed back. Compliance perhaps? Eh. Its a finishing touch or an unfinished feature.

    Get over it! Its the TCP stack that makes this baby interesting.

    --
    Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.