Little help please with forwarding traffic to proxy server!

hi all, little help please with this error message
i got this when i ran my code and requested only the home page of the google at my client side !!
GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: en-us
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727)
Host: www.google.com
Connection: Keep-Alive
Cookie: PREF=ID=a21457942a93fc67:TB=2:TM=1212883502:LM=1213187620:GM=1:S=H1BYeDQt9622ONKF
HTTP/1.0 200 OK
Cache-Control: private, max-age=0
Date: Fri, 20 Jun 2008 22:43:15 GMT
Expires: -1
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Server: gws
Content-Length: 2649
X-Cache: MISS from linux-e6p8
X-Cache-Lookup: MISS from linux-e6p8:3128
Via: 1.0
Connection: keep-alive
GET /8SE/11?MI=32d919696b43409cb90ec369fe7aab75&LV=3.1.0.146&AG=T14050&IS=0000&TE=1&TV=tmen-us%7Cts20080620224324%7Crf0%7Csq38%7Cwi133526%7Ceuhttp%3A%2F%2Fwww.google.com%2F HTTP/1.1
User-Agent: MSN_SL/3.1 Microsoft-Windows/5.1
Host: g.ceipmsn.com
HTTP/1.0 403 Forbidden
Server: squid/2.6.STABLE5
Date: Sat, 21 Jun 2008 01:46:26 GMT
Content-Type: text/html
Content-Length: 1066
Expires: Sat, 21 Jun 2008 01:46:26 GMT
X-Squid-Error: ERR_ACCESS_DENIED 0
X-Cache: MISS from linux-e6p8
X-Cache-Lookup: NONE from linux-e6p8:3128
Via: 1.0
Connection: close
java.net.SocketException: Broken pipe // this is the error message
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:115)
at java.io.DataOutputStream.writeBytes(DataOutputStream.java:259)
at SimpleHttpHandler.run(Test77.java:61)
at java.lang.Thread.run(Thread.java:595)
at Test77.main(Test77.java:13)

please could just tell me what is wrong with my code ! this is the last idea in my G.p and am havin difficulties with that cuz this is the first time dealin with java :( the purpose of my code to forward the http traffic from client to Squid server ( proxy server ) then forward the response from squid server to the clients !
thanx a lot,
this is my code :
import java.io.*;
import java.net.*;
public class Test7 {
public static void main(String[] args) {
try {
ServerSocket serverSocket = new ServerSocket(1416);
while(true){
System.out.println("Waiting for request");
Socket socket = serverSocket.accept();
new Thread(new SimpleHttpHandler(socket)).run();
socket.close();
catch (Exception e) {
e.printStackTrace();
class SimpleHttpHandler implements Runnable{
private final static String CLRF = "\r\n";
private Socket client;
private DataOutputStream writer;
private DataOutputStream writer2;
private BufferedReader reader;
private BufferedReader reader2;
public SimpleHttpHandler(Socket client){
this.client = client;
public void run(){
try{
this.reader = new BufferedReader(
new InputStreamReader(
this.client.getInputStream()
InetAddress ipp=InetAddress.getByName("192.168.6.29"); \\ my squid server
System.out.println(ipp);
StringBuffer buffer = new StringBuffer();
Socket ss=new Socket(ipp,3128);
this.writer= new DataOutputStream(ss.getOutputStream());
writer.writeBytes(this.read());
this.reader2 = new BufferedReader(
new InputStreamReader(
ss.getInputStream()
this.writer2= new DataOutputStream(this.client.getOutputStream());
writer2.writeBytes(this.read2());
this.writer2.close();
this.writer.close();
this.reader.close();
this.reader2.close();
this.client.close();
catch(Exception e){
e.printStackTrace();
private String read() throws IOException{
String in = "";
StringBuffer buffer = new StringBuffer();
while(!(in = this.reader.readLine()).trim().equals("")){
buffer.append(in + "\n");
buffer.append(in + "\n");
System.out.println(buffer.toString());
return buffer.toString();
private String read2() throws IOException{
String in = "";
StringBuffer buffer = new StringBuffer();
while(!(in = this.reader2.readLine()).trim().equals("")){
buffer.append(in + "\n");
System.out.println(buffer.toString());
return buffer.toString();
Edited by: Tareq85 on Jun 20, 2008 5:22 PM

Similar Messages

  • Guys, a little help please with the update :)

    Dear my Nokia user friends!
    Can you guys give me some advices about updating my Nokia 6300 via internet??? What do you think, shall I update it? Is it safe (the main questin)? And what will I have new if I update it?
    Thanks guys, I trust yall.. I can't wait to get your replies
    Message Edited by dog4life on 06-Mar-2008 05:30 PM
    Rottweilers are reloaded guns wich can be shot automaticly any second.. "Think about it"

    Hi dog4life
    Unfortunately there is always a chance that updating using Nokia Software Updater will fail necessitating taking your device to a Nokia Care Point. On the Online Software Update Attempt History it has a lovely way of recording this event as "Failed update attempt - User aborted software update from the recovery dialog(92)". Whereas there are usually no problems if using software as a clean installation on PC, in a number of situations there are remnants of previous events left in registry which can conspire to cause problems.
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • Help please with FaceTime. The built in app seems to have disappeared from my iPad2. Bought it in Australia

    Help please with FaceTime. My built in app seems to have disappeared.

    If K Penguin's suggestion doesnt work, you will have to go to you iTunes and do a reset, that is if you do not have it in your back up library.

  • Need a little help please    Airport Express

    Need a little help please.
    I am trying to set up a wireless network at my home using Airport Express.
    I have a regular phone line running in to I assume the modem. From there, there is an Ethernet cable running from that box to the back of the PC. My question is, I think, which of those do I unplug and plug into the Airport Express, the one on the back of the PC or the one that is in the back of the modem, or is this totally wrong.
    Any help would be appreciated…
    Thanks
    In advance…
    PS I have the manual but to me it is not very clear…

    Your connection sequence would look like this:
    Internet > Modem > AirPort Express >>>wireless to your computers.
    This means that you would unplug the cable that is now connected at the back of your PC and move that connection to the AirPort Express.
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click Continue to follow the guided setup. On the third page, you will choose the option to "Create a wireless network" and continue the setup.

  • Can anyone help please with my Time Machine, I have been getting the following message The backup disk image "/Volumes/Mac Backup/Stephen Smith's iMac.sparsebundle" is already in use.

    Can anyone help please with my Time Machine, I have been getting the following message The backup disk image “/Volumes/Mac Backup/Stephen Smith’s iMac.sparsebundle” is already in use.

    See > http://pondini.org/TM/C12.html

  • Help please with 2006 Macbook 13inch, for tv hook up.

    Help please with 2006 Macbook 13inch, to hook up to tv for streaming. The display works through VGA but the audio isn't working. Got a plug that goes into headphone jack on computer and connects into the audio jack on the back of tv but no sound. I'm not quite sure what the issue is, whether its the wrong plug, the tv, or the computer. Best Buy says this is the right plug and it seems that it would be, but who knows. If anyone has any experience in this, I would appreciate the help!

    Make sure those audio plugs are matched with the VGA plug. With your MacBook running something with audio switch between your sources on the TV Component, Composite and such. See if the sound is coming from another source. If so then you've got your audio plugs in the wrong jacks.
    Also could you post the make and model number of your TV.

  • Help Please with Driver

    I need to install the ADB Interface for the X2 onto my computer. Does any one know how or where I can get this driver?

    <Duplicate post.  Please see Help Please with Driver  for any replies.  This post will be closed.>

  • Guys, a little help please ???

    Guys, a little help please before i launch my new toys out of my pram   I've got the new apple TV, Ipad2, and IOS5 update. I'm trying to set up mirrorring , however, when i double click the home page and swipe, the only options it gives me are Ipad or Apple TV. The video shows that i should be able to simply click on mirrorring and whazam it appears on my TV... I can't get this option.... I've rebooted them (router, ipad 2 and Apple Tv) numerous times but still can't get it.......Can someone tell me what I'm doing wrong?
    Thanks

    Sounds as though the options you're getting are the standard Airplay output icons.
    Check current AppleTV software version in Settings>General>About
    Latest is 4.4.2 - there's a sticky at the top of the page about updating - if you're on 4.3 or lower just update from Settings.
    Maybe someone can confirm the video you mention is actually the correct way to invoke mirroring - link?
    (Yn anfodus heb iPad2 does dim syniad 'da fi os ydi'r Mirroring yn gweithio fel yn y fideo - oes linc i'r fideo, rhag ofn bod y fideo'n anghywir?)
    AC

  • I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/, I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/

    I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/, I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/

    Your phone is carrier locked to a carrier other than the one you are trying to use.
    It was apparently hacked to unlock it prior to your attempt to update. Updating has re-locked it to the original carrier.
    Contact them and find out what their policy is.

  • Help please, with port forwarding settings

    I have an MSI RG60 wireless router (Ethernet hard wired to my XP Home PC) and don't know what settings to use for port forwarding, to enable my WinMX and BitTorrent clients to work successfully.
    I have the port numbers, and assume that this information goes in the Service Port box, i.e. 6699, or 6881-6889.
    I know which ports are TCP and which are UDP, but I don't know what IP address to enter or which Common Service Port type to choose. Can anyone help please?
    I'm pretty sure that other settings in my PC are OK as I have successfully been running a Belkin router for a couple of years, and have only replaced it with the new MSI unit due to reliability problems.

    It does indeed have port triggering, but it wants incoming and trigger port protocol info, along with trigger and incoming port numbers.
    How can I type ipconfig into either of teh clients...WinMx or Bit Torrent?

  • Need Help Please with Flash Professional - No Cursor Change on Buttons/Links in Mac OS

    Hi Folks, I am relatively new to Flash Professional but I recently built a very nice flash website with very little problems.  I noticed after I uploaded my site to my server, that my mouse cursor did not change from an arrow to a finger on any of my buttons.  It did change on the hyperlinks, but not on the buttons.  Everything still worked fine but there was no indication to the user that an object was in fact an interactive button.  I found this code:  button1.buttonMode = true; button1.useHandCursor = true; and inserted it for all my buttons and that seemed to fix everything, I tested the site on firefox, ie, and safari.  I am using a PC with windows 7.  When I went to check the website on a Mac powerbook, the cursor did not change on any of the buttons and it does not change on any of my hyperlinks either.  I have searched all over trying to find a solution and have had no luck.  Can anyone please help me with this problem or point me in the right direction?  Any advice would be very much appreciated.  Thanks so much!!!

    Thank you so much for replying!  I did in fact let flash professional create the HTML page for the site and have not altered it at all.  Would you have any other suggestions as to why it's not displaying my links/buttons on a Mac?  I checked out the browsers Firefox, ie, and safari on my pc, but looking thru safari on the Mac, the cursor does not change on any of my links or buttons.  Thanks again so much for the reply, nice to hear from a human instead of reading thousands of posts!  Very much appreciated!!!!!

  • Help please with my navigation buttons

    Can anyone please help me with my vertical navigation buttons. I'm trying to set up my nav bar so that all the buttons have a background image (button.jpg) behind them at all times and the only thing that changes when touched or the mouse rolls over them is that the colour of the text changes, except when the sub buttons appear, because the name of some of the sub buttons are so long i have created another button image that is longer (button2.jpg), i only want this to appear on sub buttons otherwise the buttons will end up taking most of the pages space. I'm having great difficulties getting the sub buttons to appear with the correct image (button2.jpg) and am getting increasingly frustrated with it, can anyone please help!!!
    www.milesfunerals.com/index2.html

    index2.html is a broken link for sure. The main index page looks like it's working fine.
    A little styling critique if it's okay... Personally I'd have gone with a CSS or Javascript multi-level menu across the bottom of the header. Saves visitors from having to scroll all the way down the page to see every menu item. And I'd rethink the color of the "Miles & Daughters" in the header image. It kinda gets lost in the roses.
    If you have a link to the "broken" page please put it up so we can analyze it.

  • Help please with Mail attachements

    Can anyone help please. When I send an email with an attachment such as a jpeg to a Windows user the recipient complains that the attachment is embedded in the email and can not be extracted to forward, or print for example. I end up having to use Entourage for Mac to send attachments which works for them but is a pain to me.
    What do I need to do to have truly Windows Friendly attachments?
    Thanks in anticipation.

    When a PC Outlook user gets a jpg you have attached, even clicking USE WINDOWS FRIENDLY ATTACHMENTS will not alter it. We've done several experiments here and it seems that if you select USE RICH TEXT for formatting in mail preferences MAIL determines that you want to imbed the graphic rather than attach it. If you select use plain text, the jpg will attach properly, but you lose any HTML signatures you have set up, which is a problem for me.
    If a yahoo mail is sent from the Mail client, it automatically changes to plain text.
    I like Mac Mail, but I want control over how the attachments are sent, so I can have my jpg not imbedded and my HTML signature.
    Nancy

  • Help Please with 4.0

    I am trying to get Proxy Server 4.0 to proxy FTP and HTTPS. HTTP works just fine using virtual multihosting (couldn't get it to work using forward and reverse). For HTTPS I get access denied in the browser. The url to the secure site is an http that gets redirected to the same in https. The http site is part of the virtual multihosting configuration. FTP times out before establishing a connection. I have tried all modes, none work. Listening ports 80, 21, and 443 are configured. No security is configured. ACLs are the defaults and I changed them to allow any any for the sake of trying to get this to work. Can someone please help?

    Tried the email... got this
    Your message did not reach some or all of the intended recipients.
    Subject:     Web Proxy 4.0.2
    Sent:     12/6/2005 4:01 PM
    The following recipient(s) could not be reached:
    [email protected] on 12/6/2005 3:51 PM
    The e-mail account does not exist at the organization this message was sent to. Check the e-mail address, or contact the recipient directly to find out the correct address.
    <relay21.sun.com #5.1.1 smtp;550 5.7.1 <[email protected]>... Access denied>
    So much for that.

  • A little help needed with AppleScript

    Hi:
    I need a little help with AppleScript.
    I created an AppleScript application to copy some files to a LAN disk that I always have mounted. The application works fine, except that it creates some sort of a lock that prevents me from doing other work with the Finder until the copy process is completed.
    If anyone has any ideas for how I can disable this lock, please let me know. I have included the source code of my script below.
    Thanks,
    -AstraPoint
    ===== source code =====
    with timeout of 1500 seconds
    tell application "Finder"
    activate
    set current_date to (do shell script "date '+%Y-%m-%d at %H-%M-%S'") as string
    set name_p to "Personal Data " & current_date & ".dmg"
    set name_d to "Documents " & current_date & ".dmg"
    (* copy the target files to another local disk - to create an extra backup *)
    duplicate file "Personal Data.dmg" of folder "File Backups" of disk "Macintosh HD" to folder "Ad Hoc Backups" of disk "Macintosh HDx" replacing yes
    set the name of file "Personal Data.dmg" of folder "Ad Hoc Backups" of disk "Macintosh HDx" to name_p
    duplicate file "Documents.dmg" of folder "File Backups" of disk "Macintosh HD" to folder "Ad Hoc Backups" of disk "Macintosh HDx" replacing yes
    set the name of file "Documents.dmg" of folder "Ad Hoc Backups" of disk "Macintosh HDx" to name_d
    (* mount remote disk/folder using the alias file on our desktop *)
    open alias file "disk HD5"
    (* copy the target files to a remote disk - to create an extra backup *)
    duplicate file name_p of folder "Ad Hoc Backups" of disk "Macintosh HDx" to folder "Bkup" of disk "HD5" replacing yes
    duplicate file name_d of folder "Ad Hoc Backups" of disk "Macintosh HDx" to folder "Bkup" of disk "HD5" replacing yes
    end tell
    end timeout

    Try:
    ignoring application responses
    Documented [here|http://developer.apple.com/library/mac/#documentation/AppleScript/Concept ual/AppleScriptLangGuide/reference/ASLRcontrolstatements.html].
    Message was edited by: xnav

Maybe you are looking for

  • Can we implement the custom sql query in CR for joining the two tables

    Hi All, Is there anyway to implement the custom sql query in CR for joining the two tables? My requirement here is I need to write sql logics for joining the two tables... Thanks, Gana

  • HP Blade Cisco MDS 9124e

    Hello all, I got a new c7000 with some MDS swithes.  I'm trying to get to the latest software.  I started at 4.1.x and can only get to 4.2.9.  I'm then trying to upgrade to 5.0.4d it fails.  In Fabric Manager it fails during copying and when i try to

  • Format fields to Kg

    I need some help in Acrobat X. In the format tab, under properties for a form field, I need to be able to input only numbers, the only separator to be a single "point" .. like  " 4.5" and "kg" to be added automatically. Basically, the form should beh

  • Want just text in menu bar

    Hi, Whenever I create a menu it always creates grey boxes around each section however i just want it to be the text only and the text is also in white however I want that to be in black, how do I change this? Thanks in advance

  • Problems displaying Web Templates in Enterprise Portal

    Hi folks, I'm trying to create an iView showing a BI-Webtemplate. Both systems, the BI and the EP are running on different servers in the same domain and are both using Netweaver 7.0. I've created a new system using the "SAP System Dedicated Applicat