|
| ||||||||||
| Tags: http, hyper texttransfer protocol, protocol, proxy, transport layer |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Create proxy http
I am trying to write a http proxy in java using sockets. I get the header of the browser. Then I forward it to the web server. Then I get the header from the server and the message. Problem: The server does not send the message length ( "Content-Length:") How do I know where I must stop reading? I tried several methods Quote:
Last edited by Ash maker : 27-01-2010 at 09:29 AM. |
|
#2
| ||||
| ||||
| Re: Create proxy http
Hello, Just check this part of the code Quote:
__________________ Grand Theft Auto 4 PC Video Game |
|
#3
| |||
| |||
| Re: Create proxy http
Hello, Thank you for your reply, My problem is rule: I have used the method read Code: (char [])!=- 1 |
|
#4
| |||
| |||
| Re: Create proxy http
Hello, Even I have the same problem with the program, I am also trying the same code on the http proxy. I am half done. It crashes in this statement: Code: while ((buffer = in.readLine ())! = null) |
|
#5
| ||||
| ||||
| Creating an http proxy code
Hello, I still have the problem to retrieve the message from the server in the header if I do not have the message length. I tried the 2 methods but none of them worked. this is my code here. Code: while( true )
{
buff = fromServer.readLine();
if(buff == null) break;
message + = buff +"\ r\ n";
} |
|
#6
| ||||
| ||||
| Re: Create proxy http
Hi, What feeds you use to retrieve the data? It seems that some flow block until there is no data. If I remember avalaible function () which returns you the number of bytes that can still be read, look in the javadoc it will help you, try using this method and then see if the code runs. If you have any problem then do post back.
__________________ Grand Theft Auto 4 PC Video Game |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Create proxy http" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Not able to connect to local HTTP Server due to OfficeScan Proxy | Glinda | Networking & Security | 8 | 23-08-2011 12:56 PM |
| iOS 4 Wifi Problems iPhone 3GS, HTTP Proxy...worked fine on 3.1.2/3.1.3 | Hectorss | Portable Devices | 6 | 14-10-2010 05:58 PM |
| Cydia via http proxy? | Saket Shukla | Portable Devices | 8 | 28-09-2010 11:37 PM |
| Not able to connect Assassins Creed 2 online via HTTP proxy | Courtenay | Video Games | 4 | 13-03-2010 12:16 PM |
| Connect to HTTP with FQDN using proxy | fragranz | Networking & Security | 4 | 02-02-2010 07:45 AM |