package java.net; import java.io.*; /** An RCX version of URLConnection that uses the RCX version of Socket. * Socket uses a proxy called SocketProxy running on the PC. It connects * to it using the josx.rcxcomm package. * This version ignores all http headers. * @author Lawrie Griffiths */ public class URLConnection { private InputStream in; private OutputStream out; private Socket socket; static final private char [] get = {'G','E','T',' '}; static final private char [] http = {' ','H','T','T','P','/','1','.','0','\r','\n','\r','\n'}; /** * Connects to a Socket via the proxy on the PC. * @param host the host to connect to * @param port the port to connect to * @param path the file to get */ public URLConnection(String host, int port, String path) throws IOException { // Open the socket socket = new Socket(host,port); in = socket.getInputStream(); out = socket.getOutputStream(); // Do an http get char [] pathChars = path.toCharArray(); for(int i=0;i