[squid-users] Curl vs Wget on Squid

From: jose luis sanchez <joseluis.sanchez_at_m-centric.com>
Date: Thu, 20 Aug 2009 12:51:01 +0200

Hi all.
I have an squid proxy installed and configured by default, on an Ubuntu
9.04 installation.

The proxy it at localhost:3128, by default, and a http server is
listening on port 8080 ( tomcat ) , with some application of mine.

Sending the SAME request, from curl and from wget, i get different
behaviours.
With curl, i reach the 8080 server directly, but from wget, i receive a
HTTP/1.0 400 Bad Request response on first instance, and then, the 8080
server answers.

The problem is that my application only listens to the first response,
thus, getting a 400 Bad request, failing :(

Is anything related to squid or may it be related to wget ?

Thanks !

curl --proxy localhost:3128 "http://localhost:8080/MyApplication"
1250765060.328 4 127.0.0.1 TCP_MISS/200 372 GET
http://localhost:8080/MyApplication - DIRECT/127.0.0.1 text/plain

wget --proxy localhost:3128 "http://localhost:8080/MyApplication"
1250765027.366 0 127.0.0.1 TCP_DENIED/400 1656 GET
error:invalid-request - NONE/- text/html

Setting --proxy (useproxy) to 1
DEBUG output created by Wget 1.11.4 on linux-gnu.

--2009-08-20 12:47:35-- http://localhost:3128/
Resolviendo localhost... 127.0.0.1
Caching localhost => 127.0.0.1
Conectando a localhost|127.0.0.1|:3128... conectado.
Created socket 3.
Releasing 0x08e81158 (new refcount 1).

---request begin---
GET / HTTP/1.0
User-Agent: Wget/1.11.4
Accept: */*
Host: localhost:3128
Connection: Keep-Alive

---request end---
Petición HTTP enviada, esperando respuesta...
---response begin---
HTTP/1.0 400 Bad Request
Server: squid/2.7.STABLE3
Date: Thu, 20 Aug 2009 10:47:35 GMT
Content-Type: text/html
Content-Length: 1265
Expires: Thu, 20 Aug 2009 10:47:35 GMT
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from josete
X-Cache-Lookup: NONE from josete:3128
Via: 1.0 josete:3128 (squid/2.7.STABLE3)
Connection: close

---response end---
400 Bad Request
Closed fd 3
2009-08-20 12:47:35 ERROR 400: Bad Request.

--2009-08-20 12:47:35-- http://localhost:8080/MyApplication
Found localhost in host_name_addresses_map (0x8e81158)
Conectando a localhost|127.0.0.1|:8080... conectado.
Created socket 3.
Releasing 0x08e81158 (new refcount 1).

---request begin---
GET /MyApplication HTTP/1.0
User-Agent: Wget/1.11.4
Accept: */*
Host: localhost:8080
Connection: Keep-Alive

---request end---
Petición HTTP enviada, esperando respuesta...
---response begin---
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Date: Thu, 20 Aug 2009 10:47:35 GMT
Accept-Ranges: bytes
Server: Noelios-Restlet-Engine/1.1.5
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 3
Connection: keep-alive

---response end---
200 OK
Registered socket 3 for persistent reuse.
Longitud: 3 [text/plain]
Guardando: «MyApplication»
Received on Thu Aug 20 2009 - 10:51:15 MDT

This archive was generated by hypermail 2.2.0 : Fri Aug 21 2009 - 12:00:03 MDT