Ok so I started to make my own proxy and have got the client to connect to it but when I connect to the AuthServer I get the output -597210518-11065-488, I'm not sure if thats the right output. Ill post my code so far. I would appreciate it if someone pointed out what I'm doing wrong. thanks :)
Java
Java
Code:
package lightproxy;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.MulticastSocket;
import java.net.ServerSocket;
import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class Main{
public static void main(String args[]) throws IOException{
//Client Port number
final int PORT = 9959;
String AuthIp = "208.96.34.46";
//Connects to client
ServerSocket Client = new ServerSocket(PORT);
System.out.println(getTime() + "Waiting for connections on Port : " + PORT);
Socket Clientsoc = Client.accept();
System.out.println(getTime() + "Client connected");
//Connects to Auth Server
Socket s = new Socket(AuthIp,PORT);
BufferedInputStream in = new BufferedInputStream(s.getInputStream());
while(true){
int end = in.read();
if(end == -1)
break;
else{
byte b = (byte)end;
System.out.print(b);
}
}
}
public static String getTime(){
Calendar cal = java.util.GregorianCalendar.getInstance ( ) ;
SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy/MM/dd hh:mm:ss" ) ;
return (sdf.format(cal.getTime())) + " : ";
}
}