Lawrence Tan

Greenhorn
+ Follow
since Oct 17, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lawrence Tan



hi all, I am dealing with an assignment that needs me to send large text file through UDP. I am able to read the 10000 byte but when i set pkt_size to 1000, it only delivery 1000 byte which is 1KB of data over. How do i break large file to small packets to send?
thanks for your help! however am still faced witth a situation here, i tried loading youtube, the front page loaded but when i tried accessing the videos with path /watch?tv .... something, youtube displays a page saying video not found. i am guessing my get is wrong. i send GET the entire path name + host, i tried taking out its the same.

i used firebug to track my header request and it says 404.
Hi All, I am dealing with a Proxy Assignment that

1) Uses a FireFox Browser --> Send request to Proxy (My program) --> Forward Request to HTTP Server
2) HTTP Server ---> Respond to Proxy (My Program) ---> Respond send back to FireFox Browser to load page

This is my code :



This is my Output :

Creating server socket on port 8128
Accepted connection from /127.0.0.1
null
Accepted connection from /127.0.0.1
GET http://stackoverflow.com/questions/12900825/how-do-i-forward-the-http-request-back-to-the-browser-proxy-java HTTP/1.0
Host: stackoverflow.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Proxy-Connection: close
Pragma: no-cache

After getting this information, i have trouble forwarding this back to the browser to load the page. Am not sure whats wrong, i tried opening another socket but it doesnt seems to work.