Tuesday, November 13, 2007

Can't connect to Seaside (SOLVED)

It seems that accessing Dolphin/Seaside is only possible using the URL http://localhost:8888/seaside. Every other host (e.g. "127.0.0.1" or an external IP) doesn't work. This definitely limits it's use - however I cannot imagine that this is a bug. I think this is intended behavior which I simply do not understand.

UPDATE:
This was indeed intended behavoir - of Swazoo in this case. Swazoo uses "Sites" defined by hostname, ip and port to offer virtual hosting. And these Site definitions are very strict. E.g.

site := Site new

            name: 'seaside'.

site

    host: 'localhost'

    ip: '127.0.0.1'

    port: 8888.

site

    addResource: (composite := CompositeResource

                    uriPattern: '/').

composite

    addResource: (SeasideSwazooResource

            uriPattern: 'seaside').

site

    addAlias: (SiteIdentifier

                ip: '127.0.0.1'

                port: 8888

                host: 'localhost');

    addAlias: (SiteIdentifier

                ip: '127.0.0.1'

                port: 8888

                host: '172.16.1.128').

SwazooServer singleton

    addSite: site.

SwazooServer start


This site definition will listen only to http://localhost:8888/seaside/. Even http://127.0.0.1:8888/seaside/ won't work as 127.0.0.1 does not equal localhost for Swazoo (although it does for DNS).

The solution is to use Site Aliases to allow Swazoo to handle thos situations. E.g.:

site

    addAlias: (SiteIdentifier

                ip: '127.0.0.1'

                port: 8888

                host: '127.0.0.1');

    addAlias: (SiteIdentifier

                ip: '127.0.0.1'

                port: 8888

                host: '172.16.1.128')

This allows the site to be called using http://127.0.0.1:8888/seaside/ and http://172.16.1.128:8888/seaside/.

No comments: