Hi Esteban,
On 13 Mar 2013, at 03:15, Esteban A. Maringolo <[email protected]> wrote:
> Hi,
>
> Is there a way to use the same server Seaside is using to plug a
> ZnWebSocketDelegate into it?
>
> The ZnZincServerAdaptor runs by default as the root delegator for its server
> (at whatever port it was started), but I was wondering if there is a way to
> reuse the same server Seaside (on top of Zinc) is using, to plug different
> WS handlers.
>
> By now I'm just using another server to run the WS, which is no big deal
> except to open an extra port in my server.
>
> Regards!
I have several images that run multiple servers concurrently, especially
separating the web socket stuff in a second server sounds like a good idea to
me. By fiddling with different mappings in the default handler you can actually
set up quite complex systems (like routes in other systems). But of course,
there can only be one / handler.
Regarding the Zinc Seaside Adaptor, some recent changes make it possible to run
Seaside under /seaside instead of under /.
ZnSeasideServerAdaptorDelegate>>installInServer: znServer underPrefix: prefix
"Install a ZnSeasideServerAdaptorDelegate in znServer under prefix,
provided znServer contains a ZnDefaultServerDelegate instance as
primary delegate.
Note that the incoming request is destructively modified."
| seasideDelegate |
seasideDelegate := self forServer: znServer.
znServer delegate
map: 'seaside'
to: [ :request |
request uri segments: request uri segments allButFirst.
seasideDelegate handleRequest: request ].
^ seasideDelegate
Now execute the following line
WAAdmin defaultDispatcher serverPath: prefix.
And Seaside now works mostly as usual, including links and static files. There
seem to be some links that don't work, but I guess that are actually bugs.
Mind you, this is all a bit bleeding edge ;-)
This might be interesting as well:
http://forum.world.st/Running-ZnZincServerAdaptor-outside-WAServerManager-tt4662331.html
Sven
--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill