Last active
November 17, 2019 12:49
-
-
Save sblendorio/886c06d0efa42be58df1692143b16d0b to your computer and use it in GitHub Desktop.
Client proxy for use TcpSer with WinUae.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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