netcrusher java
1.0.0
NetCrusher는 Java 용 TCP/UDP 프록시 프레임 워크이며 모든 클라이언트와 서버 사이의 중간에 배치 될 수있는 명령 줄 도구입니다.
NetCrusher는 Java 8 Nio 위에 구축되며 SLF4J를 제외하고는 외부 의존성이 없습니다.
문서를 읽으십시오.
명령 줄 도구를 얻으려면 최신 dist.tar.gz를 다운로드하십시오.
NioReactor reactor = new NioReactor ();
TcpCrusher crusher = TcpCrusherBuilder . builder ()
. withReactor ( reactor )
. withBindAddress ( "localhost" , 10080 )
. withConnectAddress ( "google.com" , 80 )
. buildAndOpen ();
// ... some actions
// emulate reconnect
crusher . reopen ();
// ... check the client connection is reestablished successfully
// closing
crusher . close ();
reactor . close (); NioReactor reactor = new NioReactor ();
DatagramCrusher crusher = DatagramCrusherBuilder . builder ()
. withReactor ( reactor )
. withBindAddress ( "localhost" , 10188 )
. withConnectAddress ( "time-nw.nist.gov" , 37 )
. buildAndOpen ();
// ... some actions
// check data is sent
Assert . assertTrue ( crusher . getInner (). getReadDatagramMeter (). getTotal () > 0 );
// closing
crusher . close ();
reactor . close ();프로젝트 루트 폴더에서 추가 샘플을 확인합니다.
수동 QA의 경우 TCP 및 Datagram 모드 모두에서 명령 줄 래퍼를 사용할 수 있습니다.
$ ./run-tcp-crusher.sh 127.0.0.1:12345 google.com:80
# Version: 0.8
# Print `HELP` for the list of the commands
# enter the command in the next line
CLOSE
[20:19:20.586] INFO TcpCrusher </127.0.0.1:12345>-<google.com/64.233.161.101:80> is closed
[20:19:20.586] INFO Crusher is closed
# enter the command in the next line
OPEN
[20:19:21.655] INFO TcpCrusher </127.0.0.1:12345>-<google.com/64.233.161.101:80> is open
[20:19:21.655] INFO Crusher is open
위키의 명령 줄 모드에 대한 자세한 내용.
< dependency >
< groupId >com.github.netcrusherorg</ groupId >
< artifactId >netcrusher-core</ artifactId >
< version >0.10</ version >
</ dependency >Wiki 페이지를 참조하십시오
Apache 라이센스 버전 2.0, http://www.apache.org/licenses/license-2.0.html