[Seaside] Virtual Hosts served directly by Seaside WAKom
barger at barnet.sk
Sat Nov 18 06:50:19 UTC 2006
I am under upgrade to new version of Seaside, and in this case I was doing
some improvements which may be useful for someone else too.
Here is simple serving of Virtual Hosts directly by Seaside WAKom.
Main class with simple url rewrite rule is WADispatcher:
handlerForRequest: aRequest relativeTo: base
| path host name relativePath |
path := aRequest url.
host := (aRequest headers) at: 'host'.
path size < 2 ifTrue:
host = 'squeak.barnet.sk' ifTrue: [ path := path,'barnet' ].
host = 'ges.barnet.sk' ifTrue: [ path := path,'ges' ].
aRequest url: path.
(base isEmpty or: [path beginsWith: base]) ifTrue:
[relativePath := path allButFirst: base size.
(relativePath notEmpty and: [relativePath first =
[name := (relativePath findTokens: '/')
at: 1 ifAbsent: [default].
^ entryPoints at: name ifAbsent: [
entryPoints at: default
new ] ] ] ].
^ WANotFoundHandler new
If you are interested you can download simple cs file here :
And test it here :
Main reason is that I don't want to run more images on the same machine on
different ports and also I dont want to study how to fool requests by Apache
modules. Today I will add https ssl by stunnel for handling secure
connections by the same squeak image. If you are interested in permanent
link implementations I can post updated version later too. Old is here :
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Seaside