Client crashes when writing C5 48 69 12 B3 D5 C2 8A

06/02/2010 04:27 princeofpain#1
Hi, I'm trying to write a proxy in Java (for educational purposes and personal use) and I was having some problems sending C5 48 69 12 B3 D5 C2 8A to the client, it would simply close every time I write to the socket using

Code:
sendC=soc.getOutputStream();
sendC.write(byte1);
What is the correct way to write packets to the socket? Any links or advice would be much appreciated.
06/02/2010 04:51 s.bat#2
Quote:
Originally Posted by princeofpain View Post
Hi, I'm trying to write a proxy in Java (for educational purposes and personal use) and I was having some problems sending C5 48 69 12 B3 D5 C2 8A to the client, it would simply close every time I write to the socket using

Code:
sendC=soc.getOutputStream();
sendC.write(byte1);
What is the correct way to write packets to the socket? Any links or advice would be much appreciated.
The OutputStream#write method would be the correct way to write data to the socket, and your code looks like it's doing exactly that, but I can't tell for sure with just those two lines.
AFAIK, the client usually closes when you're sending invalid (improperly structured, unencrypted data to it).
06/02/2010 05:26 princeofpain#3
Thanks, I got it working now.