Hi All,

I configured a proxy server in ESB 5.0.0 as given here in [1] as [2]. I
have an API[3] deployed in ESB which calls to a backend service. I have a
ballerina service with a server connector as the backend service. I used a
squid proxy as the intermediary proxy server and configured it by giving
the http_port as 3128. When I invoke the API from a curl it shows an error
like in the attached file.
When I call the same backend with a curl command with the squid proxy as
[4], it works fine.

[1]* https://docs.wso2.com/display/ESB500/Working+with+Proxy+Servers
<https://docs.wso2.com/display/ESB500/Working+with+Proxy+Servers>*

[2]    <transportSender name="http" class="org.apache.synapse.tran
sport.passthru.PassThroughHttpSender">
        <parameter name="non-blocking" locked="false">true</parameter>
        <!--<parameter name="warnOnHTTP500" locked="false">*</parameter>-->
        <parameter name="http.proxyHost" locked="false">127.0.0.1</para
meter>
        <parameter name="http.proxyPort" locked="false">3128</parameter>
        <!--<parameter name="http.nonProxyHosts"
locked="false">localhost|moon|sun</parameter>-->
        </transportSender>

[3] <api xmlns="http://ws.apache.org/ns/synapse"; name="ttt" context="/b">
     <resource methods="POST GET" uri-template="/">
      <inSequence>
         <log level="custom">
            <property name="ESB" value="received============"/>
         </log>
         <send>
            <endpoint>
               <http uri-template="http://localhost:9090/hello"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="custom">
            <property name="ESB" value="response received============"/>
         </log>
         <send/>
      </outSequence>
   </resource>
</api>

[4] curl -v http://localhost:9090/hello --proxy 127.0.0.1:3128

Please correct me if I have done something wrong.

Thanks and Regards

-- 
*Bhashinee Nirmali*
*Software Engineer*
*WSO2 Lanka (Private) Limited: **http://wso2.com
<http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>*
*lean.enterprise.middle-ware*


*phone: (+94) 71 21 50003*
<http://wso2.com/signature>
*   Trying 172.17.0.1...
* Connected to 172.17.0.1 (172.17.0.1) port 8280 (#0)
> GET /b HTTP/1.1
> Host: 172.17.0.1:8280
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 400 Bad Request
< X-Cache: MISS from bhashinee-ThinkPad-X1-Carbon-5th
< X-Cache-Lookup: NONE from bhashinee-ThinkPad-X1-Carbon-5th:3128
< Vary: Accept-Language
< X-Squid-Error: ERR_INVALID_URL 0
< Mime-Version: 1.0
< Content-Language: en
< Content-Type: text/html;charset=utf-8
< Via: 1.1 bhashinee-ThinkPad-X1-Carbon-5th (squid/3.5.12)
< Date: Mon, 30 Oct 2017 15:18:21 GMT
< Transfer-Encoding: chunked
< Connection: Close
< 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2015 The Squid Software 
Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!-- 
 /*
 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
 *
 * Squid software is distributed under GPLv2+ license and includes
 * contributions from numerous individuals and organizations.
 * Please see the COPYING and CONTRIBUTORS files for details.
 */

/*
 Stylesheet for Squid Error pages
 Adapted from design by Free CSS Templates
 http://www.freecsstemplates.org
 Released for free under a Creative Commons Attribution 2.5 License
*/

/* Page basics */
* {
        font-family: verdana, sans-serif;
}

html body {
        margin: 0;
        padding: 0;
        background: #efefef;
        font-size: 12px;
        color: #1e1e1e;
}

/* Page displayed title area */
#titles {
        margin-left: 15px;
        padding: 10px;
        padding-left: 100px;
        background: url('/squid-internal-static/icons/SN.png') no-repeat left;
}

/* initial title */
#titles h1 {
        color: #000000;
}
#titles h2 {
        color: #000000;
}

/* special event: FTP success page titles */
#titles ftpsuccess {
        background-color:#00ff00;
        width:100%;
}

/* Page displayed body content area */
#content {
        padding: 10px;
        background: #ffffff;
}

/* General text */
p {
}

/* error brief description */
#error p {
}

/* some data which may have caused the problem */
#data {
}

/* the error message received from the system or other software */
#sysmsg {
}

pre {
    font-family:sans-serif;
}

/* special event: FTP / Gopher directory listing */
#dirmsg {
    font-family: courier;
    color: black;
    font-size: 10pt;
}
#dirlisting {
    margin-left: 2%;
    margin-right: 2%;
}
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {
    border-bottom: groove;
}
#dirlisting td.size {
    width: 50px;
    text-align: right;
    padding-right: 5px;
}

/* horizontal lines */
hr {
        margin: 0;
}

/* page displayed footer area */
#footer {
        font-size: 9px;
        padding-left: 10px;
}


body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, 
sans-serif; float: right; }
:lang(he) { direction: rtl; }
 --></style>
</head><body id=ERR_INVALID_URL>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a 
href="/hello">/hello</a></p>

<blockquote id="error">
<p><b>Invalid URL</b></p>
</blockquote>

<p>Some aspect of the requested URL is incorrect.</p>

<p>Some possible problems are:</p>
<ul>
<li><p>Missing or incorrect access protocol (should be <q>http://</q> or 
similar)</p></li>
<li><p>Missing hostname</p></li>
<li><p>Illegal double-escape in the URL-Path</p></li>
<li><p>Illegal character in hostname; underscores are not allowed.</p></li>
</ul>

<p>Your cache administrator is <a 
href="mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_INVALID_URL&amp;body=CacheHost%3A%20bhashinee-ThinkPad-X1-Carbon-5th%0D%0AErrPage%3A%20ERR_INVALID_URL%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Mon,%2030%20Oct%202017%2015%3A18%3A21%20GMT%0D%0A%0D%0AClientIP%3A%20127.0.0.1%0D%0A%0D%0AHTTP%20Request%3A%0D%0A%0D%0A%0D%0A";>webmaster</a>.</p>
<br>
</div>

<hr>
<div id="footer">
<p>Generated Mon, 30 Oct 2017 15:18:21 GMT by bhashinee-ThinkPad-X1-Carbon-5th 
(squid/3.5.12)</p>
<!-- ERR_INVALID_URL -->
</div>
</body></html>
* Closing connection 0
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to