HTTP server choices?

goran at krampe.se goran at krampe.se
Tue Jan 3 22:27:31 UTC 2006


Hi!

Sidenote: Janko Mivsek (swazoo maintainer) actually posted about merging
Kom and Swazoo back in october.

Andreas Raab <andreas.raab at gmx.de> wrote:
> > Kom is pretty small and simple and performs quite impressively. Stephen
> > Pair rewrote the original code from Bolot quite a bit and the code is
> > IMHO quite clean - both KomServices and DynamicBindings are nice base
> > components.
> 
> Is there anything that resembles (dare I say it?) the "D-word"[*] for 
> Kom? I *know* that I'll have to hack it and understanding where to start 
> would be invaluable. Any other sources of information?

Mmm, docs are scarce. The only part "tricky" in Kom IMHO is how to set
up the modules - the architecture for that feels a bit overengineered.
But for most uses you don't need to, if you use HttpView2 it is fully
hidden.

I think the easiest way to see how Kom works is to install HttpView2 on
top of it and play with the examples. If you set a breakpoint in the
examples you can easily inspect the call chain and find the "heart" of
Kom (in KomServices) etc.

For 3.8 do:

- Execute "SMSqueakMap bootStrap" (to upgrade to SM2.1)
- Install DynamicBindings, KomServices and KomHttpServer.
- Install HTMLBuilder, HttpView2
- Look at class comment of HVHelloWorld, set a "self halt" in
HVHelloWorld>>default and start it using "HVHelloWorld startDebug", surf
to localhost:8080

> [*] Which is documentation of course.
> 
> > And with the new FastSocketStream (standard in 3.9) I wrote it's even
> > faster - especially for some usage patterns (file upload being the prime
> > example, about 10 times faster).
> 
> And that would actually be a prime usage in certain situations. More 
> generally speaking, are there any established patterns of "embedding", 
> say, a Seaside app in the context of a larger site (which would probably 
> use Apache or something) for the purpose of better throughput?

Most use mod_proxy and/or mod_rewrite to put Apache in front of Kom.
Very easy to do. Apache can then serve static files etc, which it of
course can do better.

> > But while I have a VM hacker reading - I would like to get a new
> > primitive for String searching or modify the existing one. The problem
> > is that I want to search inside a buffer from a start position to an end
> > position. But the primitive only takes a start position as argument and
> > searches to the end of the buffer.
> 
> Well, what's so hard about it? Just make a new primitive to take the 
> extra argument and there you go (don't change the existing one - 
> primitives don't like messing with their number of args). Ask Tim to 
> include the new primitive in MiscPrimitivePlugin's translatedPrimitives 
> for the next VMMaker version and there's your ticket. And if you're 
> desparate just roll your own - e.g, copy MiscPrimitivePlugin to 
> MyPrimitivePlugin and change it to include just your new primitive. 
> Rinse and repeat ... err ... compile and link.

Thanks for the quick advice - just what I needed, I will do that.
 
> Cheers,
>    - Andreas

regards, Göran



More information about the Squeak-dev mailing list