MCPcopy Index your code
hub / github.com/Q16G/memory-shell / startForwarding

Method startForwarding

src/main/java/org/example/Socks5Server.java:226–232  ·  view source on GitHub ↗
(SocketChannel clientChannel, SocketChannel targetChannel)

Source from the content-addressed store, hash-verified

224 }
225
226 private void startForwarding(SocketChannel clientChannel, SocketChannel targetChannel) {
227 Thread clientToTarget = new Thread(() -> forward(clientChannel, targetChannel));
228 Thread targetToClient = new Thread(() -> forward(targetChannel, clientChannel));
229
230 clientToTarget.start();
231 targetToClient.start();
232 }
233
234 private void forward(SocketChannel source, SocketChannel destination) {
235 ByteBuffer buffer = ByteBuffer.allocate(8192);

Callers 1

Calls 1

forwardMethod · 0.95

Tested by

no test coverage detected