SQL>
SQL> set echo on
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 c utl_tcp.connection;
3 n number;
4 buffer varchar2(255);
5 BEGIN
6 c := utl_tcp.open_connection('proxy-server', 80);
7 n := utl_tcp.write_line(c, 'GET http://www.wrox.com/ HTTP/1.0');
8 n := utl_tcp.write_line(c);
9 BEGIN
10 LOOP
11 n:=utl_tcp.read_text( c, buffer, 255 );
12 dbms_output.put_line( buffer );
13 END LOOP;
14 EXCEPTION
15 WHEN utl_tcp.end_of_input THEN
16 NULL; -- end of input
17 end;
18 utl_tcp.close_connection(c);
19 END;
20 /
SQL>