D6 - Swazoo connection issue

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

D6 - Swazoo connection issue

Michael Atkisson
I have a web page that works fine on my workstation but when
I try and connect from another workstation I get a page
not found message. I am using Windows XP and my firewall is turned off.
I can the ping the workstation that is running swazoo from the
other workstations. Any ideas? Also is there a way to log
all my incomming connections and their status?

|site|
  site := Site new name: 'test'.
  site host: 'localhost' ip: '127.0.0.1' port: 8888.
 site addAlias: (SiteIdentifier
     ip: '198.23.96.14'
     port: 8889
    host: '198.23.96.14').
   SwazooServer singleton addSite: site.
   site start.

Thanks!


Reply | Threaded
Open this post in threaded view
|

Re: D6 - Swazoo connection issue

Steve Alan Waring
Hi Michael,

Try putting a "self halt" in HTTPServer>>answerTo:

Make the request from the workstation, and then open the debugger on
the server and step through the resolution to see why it isn't
matching.

I am not sure what has happened with the various SiteIdentifiers in the
later versions of swazoo, but I always felt that it needed a bit of a
clean up.

Steve
--
Steve Waring


Reply | Threaded
Open this post in threaded view
|

Re: D6 - Swazoo connection issue

Michael Atkisson
Steve,
  Thanks for your response!  It gave me a starting place to debug.  At
the moment I am stuck on understanding the following statement in
the answerTo: method

response := URIResolution resolveRequest: aRequest startingAt: self
sites..

It seems to return null when I am trying to bring up the web page from
another
workstation.  The only difference I can determine is that the ip
address's
are different in the HTTPRequest's.


Reply | Threaded
Open this post in threaded view
|

Re: D6 - Swazoo connection issue

Steve Alan Waring
Hi Michael,

I am using the older version of swazoo, so depending on what version of
swazoo you are using, I may be leading you down the wrong track.

I think you have identified the problem with the different ips. I am
guessing your example would work if you used SitePortIdentifier instead
of SiteIdentifier as an alias.

Dolphin's sockets bind to INADDR_ANY, which means that the local ip
address of the connection socket (which is set into the request's ip
instance variable) could be any of your machine's ip addresses. If you
do want to serve only from a single specific local ip, the only way
that I know how to do this is to hack into ServerSocket(2) and change
the #bind method. In my opinion, at least in the older version of
swazoo, the whole issue of defining sites is harder than it should be
due to the lack of being able to bind a server socket to a specific ip,
and the lack of a SiteIdentifier that matches against port and host
header.

However there are work arounds ... if you are happy to serve the same
content from any IP on your machine (and don't mind ignoring the host
header), the simple solution is to use SitePortIdentifier which ignores
the local ip address.

Hope this helps,
Steve
--
Steve Waring


Reply | Threaded
Open this post in threaded view
|

Re: D6 - Swazoo connection issue

Michael Atkisson
Steve,
  I am on version 9.101.  I can't find a class called
SitePortIdentifier.


Reply | Threaded
Open this post in threaded view
|

Re: D6 - Swazoo connection issue

Steve Alan Waring
Hi Michael,

OK ... what I would do in your situation is to go back to the original
suggestion and put a "self halt" in HTTPServer>>answerTo:

Make a request from the workstation, and then step into "response :=
URIResolution resolveRequest: aRequest startingAt: self sites.".

This uses a visitor pattern, so the process will jump around a bit
between the sites and the URIResolution, but you won't have to do too
much stepping before you will see the URIResolution ask the site and
alias if they are a match for the request. When your alias doesn't
match, have a look why in an inspector. Unless there is a bug in that
code (which there may be), either the ip, and/or the port, and/or the
host of the request do not match the information in that alias's
SiteIdentifier. From this you can determine what information you need
to set into the alais's SiteIdentifier. Then, you can either modify the
existing alias or add a second.

Steve
--
Steve Waring


Reply | Threaded
Open this post in threaded view
|

Re: D6 - Swazoo connection issue

Michael Atkisson
Hi Steve,
  Thanks for your help!