Hi Jakob, I had a similar problem. Do things improve when you change $proxyuri to this:
let $proxyuri := fn:concat($proxy,'?',$uri) Worked for me.. Kind regards, Geert -----Oorspronkelijk bericht----- Van: [email protected] [mailto:[email protected]] Namens Jakob Fix Verzonden: maandag 26 september 2011 16:16 Aan: General MarkLogic Developer Discussion Onderwerp: Re: [MarkLogic Dev General] Will http-get support proxies in ML 5.0 ? I'd love if this worked for us, but it doesn't. We have a "websense proxy"[1]. The following is the output from Jim's query, please note the document returned corresponds to Google's 404 (which is quite geeky "!!1", horribly invalid, but oh so very much optimized) because somehow the proxy sends as the requested URL 'http://www.google.com/www.google.com/' which doesn't exist, apparently ... <response xmlns="xdmp:http"> <code>404</code> <message>Not Found</message> <headers> <content-type>text/html; charset=UTF-8</content-type> <x-content-type-options>nosniff</x-content-type-options> <date>Mon, 26 Sep 2011 14:02:19 GMT</date> <server>sffe</server> <x-xss-protection>1; mode=block</x-xss-protection> <x-cache>MISS from www-proxy.atmyorganisation.org</x-cache> <via>1.0 net-gw2.atmyorganisation.org:3128 (squid/2.7.STABLE7)</via> <content-length>11803</content-length> <age>0</age> </headers> </response> <!DOCTYPE html> <html lang=en> <meta charset=utf-8> <title>Error 404 (Not Found)!!1</title> <style> *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{background:url(data:image/png;base64,iVBORw0KGgoAAA [more base64 data cut]) 100% 5px no-repeat;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{padding-right:205px}p{margin:22px 0 0;overflow:hidden}ins,#g{text-decoration:none}ins{color:#777}a img{border:0}#g{background:url(data:image/png;base64,iVBORw0KGgoAAA[more base64 data cut]);display:block;height:55px;margin:0 0 -7px;width:150px}* > #g{margin-left:-2px}#g img{visibility:hidden}* html #g img{visibility:visible}*+html #g img{visibility:visible} </style> <a href=//www.google.com/ id=g><img src=//www.google.com/images/logo_sm.gif alt=Google></a> <p><b>404.</b> <ins>That's an error.</ins> <p>The requested URL <code>/www.google.com/</code> was not found on this server. <ins>That's all we know.</ins> so it looks like our proxy is mishandling the request url. Btw, just trying to use the url without the protocol (http://) doesn't work either. Any more ideas welcome, of course. cheers, Jakob. [1] http://en.wikipedia.org/wiki/Websense On Thu, Sep 22, 2011 at 13:14, James Fuller <[email protected]> wrote: > in the meantime you can do something like this; > > declare function local:http-get-proxy($proxy, $uri){ > let $host := fn:tokenize($uri,'/')[3] > let $proxyuri := fn:concat($proxy,$uri) > return > xdmp:http-get($proxyuri, > <options xmlns="xdmp:http"> <headers> <Host>{$host}</Host> > </headers></options> > ) > }; > > local:http-get-proxy('http://some.proxy.com:8080','http://www.google.com') > > works with all proxy setups I tested. > > gl, Jim Fuller > > On Thu, Sep 22, 2011 at 10:43 AM, Geert Josten <[email protected]> > wrote: >> I wouldn't mind it being a general configuration option at host level >> either, by the way. That should work for most cases I guess.. >> >> Kind regards, >> Geert >> >> -----Oorspronkelijk bericht----- >> Van: [email protected] >> [mailto:[email protected]] Namens Jakob Fix >> Verzonden: donderdag 22 september 2011 10:32 >> Aan: General MarkLogic Developer Discussion >> Onderwerp: Re: [MarkLogic Dev General] Will http-get support proxies in ML >> 5.0 ? >> >> Hear hear! +1 >> >> I had discussion with product management people at mluc this year >> where I requested this feature, but haven't had any news since, so am >> definitely interested also! >> >> Jakob. >> >> >> >> On Thu, Sep 22, 2011 at 09:34, Geert Josten <[email protected]> wrote: >>> Hi, >>> >>> I am once more plagued by running MarkLogic Server behind a proxy and >>> trying to use xdmp:http-get and related functions. Will MarkLogic Server >>> 5.0 support proxy options (server, port, user, pass)? >>> >>> Kind regards, >>> Geert >>> >>> _______________________________________________ >>> General mailing list >>> [email protected] >>> http://developer.marklogic.com/mailman/listinfo/general >>> >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
