LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-26-2011, 07:08 PM   #1
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Squid accepts only HTTP requests but speaks FTP on the server side?


Hello everyone,

Here is my query:

Squid document says that Squid accepts only HTTP requests but speaks FTP on the server side when FTP object are requested. Can anyone please explain me what does that mean?

We call Squid HTTP and FTP caching proxy server. Does it also caches FTP contents? Is it possible to configure FTP clients to use Squid cache? When we make an FTP request to an FTP site via Squid will it be bypassed?

Thanks in advance.
 
Old 04-27-2011, 10:34 AM   #2
jadrevenge
Member
 
Registered: Mar 2011
Location: Manchester,UK
Distribution: OpenIndiana/Ubuntu
Posts: 37

Rep: Reputation: 2
if you "telnet <squid server> <squid port>" like this:

telnet squid-server 3128
Trying 192.168.1.20...
Connected to squid-server.
Escape character is '^]'.


you can then try http:// paths, or ftp:// paths e.g.:

GET http://www.google.com/ HTTP/1.0 <return>
<return>
HTTP/1.0 302 Moved Temporarily
Location: http://www.google.co.uk/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Date: Wed, 27 Apr 2011 15:29:24 GMT
Server: gws
Content-Length: 221
X-XSS-Protection: 1; mode=block
Via: 1.0 squid-server:3128 (squid/2.6.STABLE18)
Proxy-Connection: close

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.uk/">here</A>.
</BODY></HTML>
Connection to squid-server closed by foreign host.


you can also try doing the same with ftp e.g.:

GET ftp://<user>:<pass>@<server>/.procmailrc HTTP/1.0 <return>
<return>
HTTP/1.0 200 OK
Server: squid/2.6.STABLE18
Date: Wed, 27 Apr 2011 15:32:39 GMT
Content-Type: text/plain
Content-Length: 1554
Last-Modified: Wed, 27 Apr 2011 13:31:36 GMT
Via: 1.0 squid-server:3128 (squid/2.6.STABLE18)
Proxy-Connection: close

PATH=/bin:/usr/bin:/opt/sfw/bin
MAILDIR=$HOME/Maildir/ #you'd better make sure it exists
# DEFAULT=$MAILDIR/mbox #completely optional
LOGFILE=$MAILDIR/from #recommended

:0
* ^X-Advertisement:
.spam/

:0
* ^X-Advertisment:
.spam/

...


hope that helps.
 
Old 04-27-2011, 03:14 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Original Poster
Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi jadrevenge,

I tried

elnet squid-server 3128
Trying 192.168.1.20...
Connected to squid-server.
Escape character is '^]'.

and it worked

Can you please explain me about the other two things that you asked to try. I mean what is their use and what I will be able to understand if it works correctly.

Also I would appreciate if you can give me little theoretical answer to the question that I asked just to build up the things as to how they works so that I will understand what happens in the background.
 
Old 04-28-2011, 03:57 AM   #4
jadrevenge
Member
 
Registered: Mar 2011
Location: Manchester,UK
Distribution: OpenIndiana/Ubuntu
Posts: 37

Rep: Reputation: 2
when your browser talks to a proxy server (or a website) it sends the request basically like I showed you:

GET <protocol>://<site>/<url at site> HTTP/1.0 (or HTTP/1.1 depending on protocol)

after this it usually also passes in extra thinks like "Host: <site>" and user/password options ... also passing in cookies and browser details (this is how some sites know you're not using Internet Explorer)

the proxy then hands on this information, sometimes adding it's own "Proxied-for:" tag.

a new line on it's own shows the end of the request.

The protocol can be http of ftp or https even ... I believe Squid even does gopher, if you can still find gopher sites out there ...

you can see the same thing happen if you telnet to port 80 on the remote server:

$ telnet www.google.com 80
Trying 209.85.146.105...
Connected to www.l.google.com.
Escape character is '^]'.
GET http://www.google.com HTTP/1.0

HTTP/1.0 302 Found
Location: http://www.google.co.uk/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=24c6504324fea43e:FF=0:TM=1303981008:LM=1303981008:S=LrsYwkghVw0N3fwq; expires=Sat, 27-Apr-2013 08:56:48 GMT; path=/; domain=.google.com
Date: Thu, 28 Apr 2011 08:56:48 GMT
Server: gws
Content-Length: 221
X-XSS-Protection: 1; mode=block

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.uk/">here</A>.
</BODY></HTML>
Connection to www.l.google.com closed by foreign host.
 
Old 04-29-2011, 07:28 PM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Original Poster
Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Thats fine I am looking for the answer to "Why we say Squid accepts only HTTP requests but speaks FTP on the server side when FTP object are requested?"
 
Old 05-03-2011, 03:24 AM   #6
jadrevenge
Member
 
Registered: Mar 2011
Location: Manchester,UK
Distribution: OpenIndiana/Ubuntu
Posts: 37

Rep: Reputation: 2
imagine squid is a translator ... squid only talks HTTP ... even when you want to talk HTTPS or GOPHER or FTP ...

if you want a proxy that talks native in the language you want look at "delegate" ... it seems cheap in comparison to "squid", in terms of configuration ... but it works well and quick, without caching.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
redirect all http requests to a different squid proxy server r2d2#jedi Linux - Networking 1 05-27-2009 12:31 AM
FTP server that accepts any username and password Gethyn Linux - Server 2 03-11-2009 03:16 PM
How to use tcpdump to be able to see http requests sent to the server? helptonewbie Linux - Networking 4 01-12-2009 09:33 AM
Can't get my http server to respond to requests... garydamm Linux - Networking 9 01-16-2005 10:00 AM
capture http requests at squid ssharma_02 Linux - Networking 1 09-26-2004 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration