跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

performance.sh

54 行 · 1.6 KB历史下载
1#!/usr/bin/env bash
2
3set -x
4
5VM=$1
6GVPROXY_SOCKET=$2
7
8echo "Testing Internet access with a server running on the host"
9
10nohup iperf3 -s > /dev/null 2>&1 &
11serverPID=$!
12
13ssh $VM curl https://iperf.fr/download/ubuntu/libiperf.so.0_3.1.3 -o libiperf.so.0
14ssh $VM curl https://iperf.fr/download/ubuntu/iperf3_3.1.3 -o iperf3
15ssh $VM chmod +x iperf3
16
17echo "TCP: sending data"
18ssh $VM LD_LIBRARY_PATH=. ./iperf3 -c host.crc.testing
19echo "TCP: receiving data"
20ssh $VM LD_LIBRARY_PATH=. ./iperf3 -c host.crc.testing -R
21
22echo "UDP: sending data"
23ssh $VM LD_LIBRARY_PATH=. ./iperf3 -c host.crc.testing -u
24echo "UDP: receiving data"
25ssh $VM LD_LIBRARY_PATH=. ./iperf3 -c host.crc.testing -R -u
26
27kill $serverPID
28
29echo "Testing forwarder with a server running in the VM"
30
31curl --unix-socket $GVPROXY_SOCKET http:/unix/services/forwarder/expose -X POST \
32 -d'{"local":":5201", "protocol": "udp", "remote": "192.168.127.2:5201"}'
33curl --unix-socket $GVPROXY_SOCKET http:/unix/services/forwarder/expose -X POST \
34 -d'{"local":":5201", "protocol": "tcp", "remote": "192.168.127.2:5201"}'
35
36ssh $VM LD_LIBRARY_PATH=. ./iperf3 -s > /dev/null 2>&1 &
37sleep 1
38
39echo "TCP: sending data"
40iperf3 -c 127.0.0.1
41echo "TCP: receiving data"
42iperf3 -c 127.0.0.1 -R
43
44echo "UDP: sending data"
45iperf3 -c 127.0.0.1 -u -l 9216
46echo "UDP: receiving data"
47iperf3 -c 127.0.0.1 -R -u -l 9216
48
49ssh $VM pkill iperf3
50
51curl --unix-socket $GVPROXY_SOCKET http:/unix/services/forwarder/unexpose -X POST \
52 -d'{"local":":5201", "protocol": "udp"}'
53curl --unix-socket $GVPROXY_SOCKET http:/unix/services/forwarder/unexpose -X POST \
54 -d'{"local":":5201", "protocol": "tcp"}'