Skip to content

Instantly share code, notes, and snippets.

@sblendorio
Last active November 17, 2019 12:49
Show Gist options
  • Save sblendorio/886c06d0efa42be58df1692143b16d0b to your computer and use it in GitHub Desktop.
Save sblendorio/886c06d0efa42be58df1692143b16d0b to your computer and use it in GitHub Desktop.
Client proxy for use TcpSer with WinUae.java
package eu.sblendorio.clienttelnetproxy;
import java.io.*;
import java.net.*;
public class MainClass {
public static void main(String argv[]) throws Exception {
Socket clientWinUae = new Socket("localhost", 1234);
Socket clientTcpSer = new Socket("localhost", 2100);
InputStreamReader inWinUae = new InputStreamReader(clientWinUae.getInputStream(), "ISO-8859-1");
OutputStreamWriter outTcpSer = new OutputStreamWriter(clientTcpSer.getOutputStream(), "ISO-8859-1");
InputStreamReader inTcpSer = new InputStreamReader(clientTcpSer.getInputStream(), "ISO-8859-1");
OutputStreamWriter outWinUae = new OutputStreamWriter(clientWinUae.getOutputStream(), "ISO-8859-1");
while (true) {
while (inWinUae.ready()) outTcpSer.write(inWinUae.read());
outTcpSer.flush();
while (inTcpSer.ready()) outWinUae.write(inTcpSer.read());
outWinUae.flush();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment