Virtual Hosts served directly by Seaside WAKom

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Virtual Hosts served directly by Seaside WAKom

barger

Hi,

 

 

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 = $/]) ifTrue:

                                   [name := (relativePath findTokens: '/') at: 1 ifAbsent: [default].

              ^ entryPoints at: name ifAbsent: [

                                               entryPoints at: default ifAbsent: [

                                                           WANotFoundHandler new ] ] ] ].

       ^ WANotFoundHandler new

 

 

If you are interested you can download simple cs file here : http://www.barnet.sk/software/squeak/Seaside/

And test it here :

http://squeak.barnet.sk

http://ges.barnet.sk

 

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 : http://lists.squeakfoundation.org/pipermail/seaside/2005-January/004276.html

 

Jan Barger

www.barnet.sk

 

 

 

 


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside