Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-05-2002, 12:04 AM   #1 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
proxy protocol?

okay, i use a proxy to connect to the net

so, im making a program that needs to access websites... (in java), but it wont connect to a site, obviously, without the proxy

...

so, how do i go about using it to request webpages? maybe this is a simple question, but i can't think of a solution at the moment...
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-05-2002, 12:27 AM   #2 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
nevermind, for those who want to know, its just:

"GET http://myurl.com HTTP/1.0"

except your host is the proxy
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-05-2002, 05:44 PM   #3 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 285
technobard is on a distinguished road
Interesting. You can also add the following to your code, before making the URLConnection:

Properties prop = System.getProperties();
prop.put("http.proxyHost","whatever.com");
prop.put("http.proxyPort","80"); //change to correct port
technobard is offline   Reply With Quote
Old 08-05-2002, 10:24 PM   #4 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
oh, okay, i might try that but im actually not using a URLConnection object, only Sockets but maybe i will see what they can do.
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-06-2002, 06:22 AM   #5 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 285
technobard is on a distinguished road
If you're lazy, you can also just use a URL object. It has less functionality than URLConnection, but it's quick and does the job. I have a sample program (without proxy code) in my NUM (shameless plug) in the java section in case you're looking for sample code. Although there is plenty of good stuff at java.sun.com and elsewhere.


technobard is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Proxy Anyone? technobard PHP 11 09-03-2004 06:22 AM
SNMP protocol (MIB) liah Standard C, C++ 0 04-29-2004 03:59 AM
IRC Connection Protocol... abc123 All Other Coding Languages 9 06-16-2002 11:10 PM


All times are GMT -8. The time now is 10:37 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting