Sponsored Content
Special Forums IP Networking Transparent Proxy with URL Rewriting Post 302604664 by crottyan on Monday 5th of March 2012 03:19:22 PM
Old 03-05-2012
Transparent Proxy with URL Rewriting

All traffic on the LAN is routed through a single machine and filtered using iptables. I'd like to redirect this traffic to a transparent proxy running on the same machine that will rewrite the URL if it matches a specified regex, in which case the user will be redirected to a local server. In other words, all HTTP requests should flow through as usual unless the user attempts to navigate to, say, "xyz.com," in which case the proxy will send the user to Apache running locally with a page displaying something like "Sorry, you can't go here." I have already investigated Squid and its URL rewriting component, but it seems terribly complicated to configure and a bit overkill since I won't be using 98% of its other features. Is there a free program other than Squid I could use, or perhaps someone could provide me with some resources for writing a program myself if it isn't too complicated?

Last edited by crottyan; 03-05-2012 at 05:46 PM..
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

IPNAT / Transparent proxy loops...

Hi! My situation: I have an OpenBSD firewall/proxy (192.168.0.1), running IPF/IPNAT w/ Squid as transparent proxy. This machine is configured to be gateway to the network. This works great, all the clients WWW-requests on the internal network are rerouted to the proxyport by this... (0 Replies)
Discussion started by: indo1144
0 Replies

2. IP Networking

Squid Proxy URL rewriting

I have an architecture as below <> <> There is a program in the AIX server which sends SMS to the internet, by sending HTTP request to the SMS processing server. Like, http://smsserver/mysms=test However the application does not have an option to specify where the Proxy server... (1 Reply)
Discussion started by: firdousamir
1 Replies

3. IP Networking

SQUID Transparent Proxy Server

hi guys! We are setting up Squid Server. we want the server to be transparent. But I don't know how will i be able to set the network up. is it possible to set the squid server in the same LAN with the Squid Client and still functions as a transparent server? if so, can anybody help me do it? ... (1 Reply)
Discussion started by: init6_
1 Replies

4. UNIX for Advanced & Expert Users

url calling and parameter passing to url in script

Hi all, I need to write a unix script in which need to call a url. Then need to pass parameters to that url. please help. Regards, gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies

5. Shell Programming and Scripting

url calling and parameter passing to url in script

Hi all, I need to write a unix script in which need to call a url. Then need to pass parameters to that url. please help. Regards, gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies

6. IP Networking

Software/tool to route an IP packet to proxy server and capture the Proxy reply as an

Hi, I am involved in a project on Debian. One of my requirement is to route an IP packet in my application to a proxy server and receive the reply from the proxy server as an IP packet. My application handles data at the IP frame level. My application creates an IP packet(with all the necessary... (0 Replies)
Discussion started by: Rajesh_BK
0 Replies

7. Shell Programming and Scripting

Need help with a shell script:Config Transparent Proxy using Shell

I want to config Transparent Proxy using Shell Script. I have more questions<exercise of me :D>: + Check that the squid is installed or not install and version is installed +Allows users to choose to run a transparent proxy or not +Perform configuration and turn on service in accordance... (0 Replies)
Discussion started by: kaka287
0 Replies

8. UNIX for Dummies Questions & Answers

Awk: print all URL addresses between iframe tags without repeating an already printed URL

Here is what I have so far: find . -name "*php*" -or -name "*htm*" | xargs grep -i iframe | awk -F'"' '/<iframe*/{gsub(/.\*iframe>/,"\"");print $2}' Here is an example content of a PHP or HTM(HTML) file: <iframe src="http://ADDRESS_1/?click=5BBB08\" width=1 height=1... (18 Replies)
Discussion started by: striker4o
18 Replies

9. Shell Programming and Scripting

Reading URL using Mechanize and dump all the contents of the URL to a file

Hello, Am very new to perl , please help me here !! I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file. below is the script which i have written so far , #!/usr/bin/perl use LWP::UserAgent; use... (2 Replies)
Discussion started by: scott_cog
2 Replies

10. UNIX for Advanced & Expert Users

Issue setup Transparent proxy and Gateway using Squid on CentOS 7

Hello, We are migrating our gateways from CentOS 6 to CentOS 7 and for setting up a transparent proxy using squid and Firewalld i am using below configuration. #Firewalld configurations firewall-cmd --permanent --zone=public --add-forward-port=port=80:proto=tcp:toport=3128:toaddr=LAN_IP... (4 Replies)
Discussion started by: sunnysthakur
4 Replies
squidclient(1)						      General Commands Manual						    squidclient(1)

NAME
squidclient -- a simple HTTP web client SYNOPSIS
squidclient [-arsv][-A string ][-g count] [-h remote-host] [-H 'string'] [-i IMS] [-I ping-interval] [-j 'Host-header'] [-l local-host] [-m method] [-p port] [-P file] [-t count] [-T timeout] [-u proxy-user] [-U www-user] [-V version] [-w proxy-password] [-W www-password] url DESCRIPTION
squidclient is a tool providing a command line interface for retrieving URLs. Designed for testing any HTTP 0.9, 1.0, or 1.1 web server or proxy. This tool can be combined with scripts to perform any basic HTTP operation. Some additional features for access to the Squid proxy object cache and management information are provided. OPTIONS
-a Do NOT include Accept: header. -A 'string' Send string as User-Agent: header. To omit the header completely set string to empty (''). -g count Ping mode, perform count iterations (0 to loop until interrupted). -h host Retrieve URL from cache on hostname. Default is localhost. -H 'string' Extra headers to send. Use ' ' for new lines. -i time If-Modified-Since time (in Epoch seconds). -I interval Ping interval in seconds (default 1 second). -j hosthdr Host header content -l host Specify a local IP address to bind to. Default is none. -m method Request method, default is GET. Squid also supports a non-standard method called PURGE. You can use that to purge a specific URL from the cache. You need to have purge access setup in squid.conf similar to manager access. Here is an example: acl purge method PURGE http_access deny purge !localhost -p port Port number of cache. Default is 3128. -P file PUT request. Using the named file. -r Force cache to reload URL. -s Silent. Do not print data to stdout. -t count Trace count cache-hops -T timeout Timeout value (seconds) for read/write operations. -u user Proxy authentication username -U user WWW authentication username -v Verbose. Print outgoing message to stderr. -w password Proxy authentication password -W password WWW authentication password -V version HTTP Version. Use '-' for HTTP/0.9 omitted case SEE ALSO
cachemgr.cgi(8), squid(8) AUTHOR
Derived from Harvest. Further developed by by numerous individuals from the internet community. Development is led by Duane Wessels of the National Laboratory for Applied Network Research and funded by the National Science Foundation. Squid Web Client Tool squidclient(1)
All times are GMT -4. The time now is 10:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy