1.8 KiB
Requirements
The tunnel server requires Java 17 or later to build and run. This requirement comes from the Spring Boot 3.x baseline.
When building the root Maven reactor with Java 8 through Java 16, tunnel-server is not enabled by default. It is included only by the root jdk17 profile.
How it works
Tunnel server/client use websocket protocol.
For example:
-
Arthas tunnel server listen at
192.168.1.10:7777 -
Arthas tunnel client register to the tunnel server
tunnel client connect to tunnel server with URL:
ws://192.168.1.10:7777/ws?method=agentRegistertunnel server response a text frame message:
response:/?method=agentRegister&id=bvDOe8XbTM2pQWjF4cfwThis connection is
control connection. -
The browser try connect to remote arthas agent
start connect to tunnel server with URL:
'ws://192.168.1.10:7777/ws?method=connectArthas&id=bvDOe8XbTM2pQWjF4cfw -
Arthas tunnel server find the
control connectionwith the idbvDOe8XbTM2pQWjF4cfwthen send a text frame to arthas tunnel client:
response:/?method=startTunnel&id=bvDOe8XbTM2pQWjF4cfw&clientConnectionId=AMku9EFz2gxeL2gedGOC -
Arthas tunnel client open a new connection to tunnel server
URL:
ws://192.168.1.10:7777/ws/?method=openTunnel&clientConnectionId=AMku9EFz2gxeL2gedGOC&id=bvDOe8XbTM2pQWjF4cfwThis connection is
tunnel connection -
Arthas tunnel client start connect to local arthas agent, URL:
ws://127.0.0.1:3658/wsThis connection is
local connection -
Forward websocket frame between
tunnel connectionandlocal connection.
+---------+ +----------------------+ +----------------------+ +--------------+
| browser <-----> arthas tunnel server | <-----> arthas tunnel client <--- -> arthas agent |
|---------+ +----------------------+ +----------------------+ +--------------+