|
Home > Archive > SQL Anywhere Mobile > August 2005 > MobiLink and HTTP redirects
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
MobiLink and HTTP redirects
|
|
| Alex van Denzel 2005-08-04, 3:24 am |
| Hello,
I have here this setup with a group of hosts running apache 2.0.46
webservers, and a group of hosts running MobiLink 9.0.1 EBF 1984 behind
them.
To enable a sort of loadbalancing I created a DNS round-robin hostname
pointing to all webservers, and an individual name for each webserver.
That works.
To make sure the MobiLink connection stays with the initially chosen
webserver I added the following lines to the apache configuration
RewriteCond %{HTTP_HOST} !^host1\..+
RewriteRule (.*) http://host1.domain.org$1 [R,L]
It works, for normal web-browsers.
It doesn't work for MobiLink!
The MobiLink client (dbmlsync) aborts with the message
E. 08/02 12:53:02. Unable to finish writing to the 'http' network
connection. An error status was returned: 'HTTP/1.1 302 Found'.
Also the UltraLite client (C++) doesn't accept a 302 redirect as
indication to retry connection with the provided "Location:" header
value.
Is this behaviour by design, is it something that is not implemented
yet but will be added in newer versions of the MobiLink client, or is
there some option I missed that could be set to enable http redirect
behaviour?
(Apologies to the double post. My original post wasn't propagated from
Google to Sybase news)
--
Alex.
| |
| David Fishburn 2005-08-08, 9:24 am |
| Alex van Denzel <vandenzel@hotmail.com> wrote in news:42f1c098@forums
-2-
dub
of sybase.public.sqlanywhere.mobilink:
AvD> I have here this setup with a group of hosts running apache 2.0.46
AvD> webservers, and a group of hosts running MobiLink 9.0.1 EBF 1984
behind
AvD> them.
AvD>
AvD> To enable a sort of loadbalancing I created a DNS round-robin
hostname
AvD> pointing to all webservers, and an individual name for each
webserver.
AvD> That works.
AvD>
AvD> To make sure the MobiLink connection stays with the initially chosen
AvD> webserver I added the following lines to the apache configuration
AvD>
AvD> RewriteCond %{HTTP_HOST} !^host1\..+
AvD> RewriteRule (.*) http://host1.domain.org$1 [R,L]
AvD>
AvD> It works, for normal web-browsers.
AvD>
AvD> It doesn't work for MobiLink!
AvD>
AvD> The MobiLink client (dbmlsync) aborts with the message
AvD> E. 08/02 12:53:02. Unable to finish writing to the 'http' network
AvD> connection. An error status was returned: 'HTTP/1.1 302 Found'.
AvD>
AvD> Also the UltraLite client (C++) doesn't accept a 302 redirect as
AvD> indication to retry connection with the provided "Location:" header
AvD> value.
AvD>
AvD> Is this behaviour by design, is it something that is not implemented
AvD> yet but will be added in newer versions of the MobiLink client, or
is
AvD> there some option I missed that could be set to enable http redirect
AvD> behaviour?
Hmm, sounds like you have 2 choices:
1. Open a case with technical support
2. Submit this to the product_futures_disc
ussion newsgroup.
I am not sure what the above lines (added to your apache config file) do
so I can't be sure it could be considered as a bug or a new feature.
--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).
EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm
Developer Community / Whitepapers
http://www.ianywhere.com/developer
CaseXpress - to report bugs
http://casexpress.sybase.com
CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
| |
| Shuchit 2005-08-08, 1:27 pm |
| Alex van Denzel <vandenzel@hotmail.com> wrote in news:42f1c098@forums
-2-dub:
> RewriteCond %{HTTP_HOST} !^host1\..+
> RewriteRule (.*) http://host1.domain.org$1 [R,L]
>
It does sound like dbmlsync and ultralite do not support http redirects.
Could you try proxying rather than doing a redirect.
Also, you might want to look at the MobiLink redirector that ships with SQL
Anywhere studio.
Shuchit
| |
| Alex van Denzel 2005-08-08, 8:25 pm |
| Shuchit wrote:
> Alex van Denzel <vandenzel@hotmail.com> wrote in news:42f1c098@forums
-2-dub:
>
>
>
>
> It does sound like dbmlsync and ultralite do not support http redirects.
That's exactly the issue
> Could you try proxying rather than doing a redirect.
That's been done _also_, but i need the redirect also
> Also, you might want to look at the MobiLink redirector that ships with SQL
> Anywhere studio.
It _is_ the redirector from the SQL Studio Anywhere (9.0.1 EBF 1984)
>
> Shuchit
>
| |
| David Fishburn 2005-08-09, 7:24 am |
| Alex van Denzel <vandenzel@hotmail.com> wrote in
news:42f7d32b$1@foru
ms-1-dub of sybase.public.sqlanywhere.mobilink:
AvD>> Also, you might want to look at the MobiLink redirector that ships
AvD>> with SQL Anywhere studio.
AvD>
AvD> It _is_ the redirector from the SQL Studio Anywhere (9.0.1 EBF 1984)
You may want to try 9.0.2 plus current EBF on a test machine to see if
the behaviour is any different.
--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).
EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm
Developer Community / Whitepapers
http://www.ianywhere.com/developer
CaseXpress - to report bugs
http://casexpress.sybase.com
CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
| |
| Alex van Denzel 2005-08-09, 11:25 am |
| Alex van Denzel wrote:
> It _is_ the redirector from the SQL Studio Anywhere (9.0.1 EBF 1984)
oops... it's 9.0.1 EBF 1989 not 1984.
--
Alex.
| |
| Alex van Denzel 2005-08-09, 11:25 am |
| David Fishburn wrote:
> You may want to try 9.0.2 plus current EBF on a test machine to see if
> the behaviour is any different.
There was some change in behaviour in 9.0.2 (at least the dbsrv9) which
was incompatible with our application, and I'd rather not mix too much
in Sybase (or iAnywhere) releases.
--
Alex
| |
| Shuchit 2005-08-11, 3:25 am |
| Alex van Denzel <vandenzel@hotmail.com> wrote in news:42f8ad4f@forums
-1-dub:
> Alex van Denzel wrote:
>
> oops... it's 9.0.1 EBF 1989 not 1984.
>
The redirector bundled with SQL Anywhere studio only does proxying but you
are asking about client-side redirects. So I do not understand how client-
side redirects fit in if you are using MobiLink redirector.
Shuchit
| |
| Greg Fenton 2005-08-11, 1:28 pm |
| Alex van Denzel wrote:
> RewriteCond %{HTTP_HOST} !^host1\..+
> RewriteRule (.*) http://host1.domain.org$1 [R,L]
>
As Shuchit points out, the above is a CLIENT-SIDE redirect (that's what
the [R] in the RewriteRule does). The server gets a request and sends
back a "302 Redirect" response to the new location (host1.domain.org...)
Dbmlsync is not a "web client". It uses HTTP as a communication
mechansim to the MobiLink server, and as such it does not support HTTP
redirects.
One way to accomplish what you want would be to use a Reverse Proxy rule
instead of a client-side redirect. Simply change the "[R,L]" to "[P,L]"
and apache will proxy the request (i.e. the request is forwarded by
Apache to host1.domain.org and the response from that request is
returned to dbmlsync). Of course, this assumes that your apache machine
can directly connect to host1.domain.org [i.e. firewall rules, etc...
don't interfere with the request].
For more information, see the mod_rewrite documentation for Apache:
http://httpd.apache.org/docs/1.3/mo...tml#RewriteRule
Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
| |
| Alex van Denzel 2005-08-11, 1:28 pm |
| Greg Fenton wrote:
> Alex van Denzel wrote:
>
>
> As Shuchit points out, the above is a CLIENT-SIDE redirect (that's what
> the [R] in the RewriteRule does). The server gets a request and sends
> back a "302 Redirect" response to the new location (host1.domain.org...)
>
> Dbmlsync is not a "web client". It uses HTTP as a communication
> mechansim to the MobiLink server, and as such it does not support HTTP
> redirects.
The trouble is:
$ host host.domain.org
host.domain.org has address 1.2.3.4
host.domain.org has address 1.2.3.5
$ host host1.domain.org
host1.domain.org has address 1.2.3.4
$ host host2.domain.org
host2.domain.org has address 1.2.3.5
To make sure once a connection is made to one of the hosts, that
connection stays with the host, also for new tcp connections and new
host lookups, I created the browser redirect.
It was configured that, after a successful browser redirect (so the
requested host will be host1, or host2) a proxy redirect will be made to
one of the MobiLink redirectors (localhost:8080, not reachable from the
outside world). That one will redirect to one of the MobiLink servers.
We worked around the problem, we programmed the UltraLite client to
select a random host from the list of hosts.
--
Alex.
| |
| Greg Fenton 2005-08-12, 9:30 am |
| Alex van Denzel wrote:
>
> It was configured that, after a successful browser redirect (so the
> requested host will be host1, or host2) a proxy redirect will be made to
> one of the MobiLink redirectors (localhost:8080, not reachable from the
> outside world). That one will redirect to one of the MobiLink servers.
>
The ML Redirector has load balancing itself. ML clients (UL and
dbmlsync) are not designed to have (client-side) load balancing in front
of the load balancing [in fact, they aren't designed to have client-side
load-balancing at all].
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
|
|
|
|
|