I want to do a chat/instant messaging type app, and if this works on all browsers, I get a weekend! If not - well, you know how it is...

Been there, done that, got the big nasty sweaty teeshirt. I'm no expert on nph's, but I, too, wanted a chat server that didn't rely on http-refresh to update the screen. I haven't examined Merlyn's Web Techniques article in depth, but I've run into problems with web browsers that (for reasons unknown) tend to "stop" refreshing at random intervals.

So I wrote a NPH chat server that worked great... cross-platform compatible (worked fine on IE and Netscape, at least) where each message appeared below the previous one. Even tacked on a little Javascript so that everytime a new message came in the window automatically scrolled to the bottom so it looked like a "traditional" chat room. Problem: it didn't work for anyone accessing from AOL. My (unconfirmed) theory was that the AOL proxy servers were beating the hell out of the headers that were being passed. So, back to the drawing board since it HAD to work with AOL-ers.

Version 2.0 Still used NPH, only this time instead of tacking on messages one after the other, the chatroom server "push" refreshes the browser so everyone always sees the latest 10 messages or so and that's it. This is functionally identical to the http-refresh method only now I don't have to worry about flaky browsers.

... but in the process I lost my IE/Netscape compatibility. Version 2 only runs on Netscape, but it DOES work with AOL (on Netscape.) sigh.

YMMV. I wish you good luck, and hey, if you come up with something I (for one) would like to see it.

Gary Blackburn
Trained Killer


In reply to Re: What's up with nph scripts? by Trimbach
in thread What's up with nph scripts? by chorg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.