نفق TCP/UDP سريع عبر HTTP مع تشفير SSH، يدعم إعادة توجيه المنافذ العكسية، ووكيل SOCKS5، والمصادقة من العميل لاختراق الشبكة بأمان وتجاوز جدران الحماية.
Chisel هو نفق TCP/UDP سريع، يُنقل عبر HTTP، ومؤمَّن عبر SSH. ملف تنفيذي واحد يشمل العميل والخادم معًا. مكتوب بلغة Go (golang). Chisel مفيد بشكل أساسي لاختراق جدران الحماية، كما يمكن استخدامه لتوفير نقطة نهاية آمنة لشبكتك.

crypto/ssh)--min/max-retry-interval)؛ تنتهي مهلة حزم البقاء على قيد الحياة، لذلك يتم اكتشاف الاتصالات الميتة بصمت (نوم/استيقاظ، انتهاء مهلة NAT، إعادة تشغيل الخادم) وإعادة إنشائهاssh -o ProxyCommand لتوفير SSH عبر HTTPانظر أحدث إصدار أو قم بتنزيله وتثبيته الآن باستخدام curl https://i.jpillora.com/chisel! | bash
تم بناء الملفات الثنائية بأحدث إصدار من Go، والذي يحدد الحد الأدنى لإصدارات أنظمة التشغيل: Windows 10 / Server 2016، macOS 12، نواة Linux 3.2، FreeBSD 12.2. للأنظمة الأقدم (مثل Windows 7)، استخدم الإصدار v1.8.1 أو إصدارات أقدم.
الصور متعددة البنى (multi-arch) وتُنشر على كل من Docker Hub (`jpillora/chisel`) وسجل حاويات GitHub (`ghcr.io/jpillora/chisel`).
### فيدورا
الحزمة تتم صيانتها من قبل مجتمع فيدورا. إذا واجهت مشكلات متعلقة باستخدام حزمة RPM، فيرجى استخدام [متتبع المشكلات](https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&classification=Fedora&component=chisel&list_id=11614537&product=Fedora&product=Fedora%20EPEL) هذا.```sh
sudo dnf -y install chisel
$ go install github.com/jpillora/chisel@latest
## العرض التوضيحي
يمكنك تشغيل خادم العرض التوضيحي الخاص بك في دقائق (اختفت نسخة Heroku التجريبية القديمة مع الطبقة المجانية لـ Heroku). يقوم [`example/fly.toml`](https://github.com/jpillora/chisel/blob/HEAD/example/fly.toml) بنشر خادم `chisel server` هذا إلى الحصة المجانية لـ [fly.io](https://fly.io):```sh
$ chisel server --port $PORT --backend http://example.com
# listens on $PORT, proxies normal web requests to http://example.com
قم بنشره باستخدام fly launch --copy-config من دليل example/، ثم أنشئ نفقًا إلى أي خدمة تعمل بجانب الخادم، على سبيل المثال:```sh
$ chisel client https://.fly.dev 3000
زيارة رابط تطبيقك في المتصفح تصل إلى الوكيل الخلفي الافتراضي للخادم وتعرض نسخة من [example.com](http://example.com).
## الاستخدام
<!-- اعرض نصوص المساعدة هذه يدويًا،
أو استخدم https://github.com/jpillora/md-tmpl
مع $ md-tmpl -w README.md -->
<!--tmpl,code=plain:echo "$ chisel --help" && go run main.go --help | sed 's#0.0.0-src (go1\..*)#X.Y.Z#' -->``` plain
$ chisel --help
Usage: chisel [command] [--help]
Version: X.Y.Z
Commands:
server - runs chisel in server mode
client - runs chisel in client mode
Read more:
https://github.com/jpillora/chisel
$ chisel server --help
Usage: chisel server [options]
Options:
--host, Defines the HTTP listening host – the network interface
(defaults the environment variable HOST and falls back to 0.0.0.0).
--port, -p, Defines the HTTP listening port (defaults to the environment
variable PORT and falls back to port 8080).
--key, (deprecated use --keygen and --keyfile instead)
An optional string to seed the generation of a ECDSA public
and private key pair. All communications will be secured using this
key pair. Share the subsequent fingerprint with clients to enable detection
of man-in-the-middle attacks (defaults to the CHISEL_KEY environment
variable, otherwise a new key is generate each run).
--keygen, A path to write a newly generated PEM-encoded SSH private key file.
If users depend on your --key fingerprint, you may also include your --key to
output your existing key. Use - (dash) to output the generated key to stdout.
--keyfile, An optional path to a PEM-encoded SSH private key. When
this flag is set, the --key option is ignored, and the provided private key
is used to secure all communications. (defaults to the CHISEL_KEY_FILE
environment variable). Since ECDSA keys are short, you may also set keyfile
to the inline key string itself, exactly as printed by --keygen (a base64
string with a "ck-" prefix); no extra base64 encoding is needed.
--authfile, An optional path to a users.json file. This file should
be an object with users defined like:
{
"<user:pass>": ["<addr-regex>","<addr-regex>"]
}
when <user> connects, their <pass> will be verified and then
each of the remote addresses will be compared against the list
of address regular expressions for a match. Patterns are NOT
anchored by default: "10.0.0.1:80" also matches
"210.0.0.1:8080", and "." matches any character. Anchor your
patterns, e.g. "^10\.0\.0\.1:80$". The empty string ""
matches every address. Addresses will
always come in the form "<remote-host>:<remote-port>" for normal remotes,
"R:<local-interface>:<local-port>" for reverse port forwarding
remotes, and "socks" for SOCKS5 proxy access. Note that SOCKS5
access previously bypassed this list; existing authfiles which
should allow SOCKS5 must add an entry matching "socks" (the
empty wildcard "" matches everything, including "socks"). This
file will be automatically reloaded on change. Reloads apply
to new connections and to new tunnels of connected clients;
established tunnels are not interrupted.
--auth, An optional string representing a single user with full
access, in the form of <user:pass>. It is equivalent to creating an
authfile with {"<user:pass>": [""]}. If unset, it will use the
environment variable AUTH.
--keepalive, An optional keepalive interval. Since the underlying
transport is HTTP, in many instances we'll be traversing through
proxies, often these proxies will close idle connections. You must
specify a time with a unit, for example '5s' or '2m'. Defaults
to '25s' (set to 0s to disable).
--backend, Specifies another HTTP server to proxy requests to when
chisel receives a normal HTTP request. Useful for hiding chisel in
plain sight. --proxy is accepted as an alias for this flag.
--socks5, Allow clients to access the internal SOCKS5 proxy. See
chisel client --help for more information.
--reverse, Allow clients to specify reverse port forwarding remotes
in addition to normal remotes.
--tls-key, Enables TLS and provides optional path to a PEM-encoded
TLS private key. When this flag is set, you must also set --tls-cert,
and you cannot set --tls-domain.
--tls-cert, Enables TLS and provides optional path to a PEM-encoded
TLS certificate. When this flag is set, you must also set --tls-key,
and you cannot set --tls-domain.
--tls-domain, Enables TLS and automatically acquires a TLS key and
certificate using LetsEncrypt. Setting --tls-domain requires port 443.
You may specify multiple --tls-domain flags to serve multiple domains.
The resulting files are cached in the "$HOME/.cache/chisel" directory.
You can modify this path by setting the CHISEL_LE_CACHE variable,
or disable caching by setting this variable to "-". You can optionally
provide a certificate notification email by setting CHISEL_LE_EMAIL.
--tls-ca, a path to a PEM encoded CA certificate bundle or a directory
holding multiple PEM encode CA certificate bundle files, which is used to
validate client connections. The provided CA certificates will be used
instead of the system roots. This is commonly used to implement mutual-TLS.
--pid Generate pid file in current working directory
-v, Enable verbose logging
--help, This help text
Signals: The chisel process is listening for: a SIGINT or SIGTERM to begin a graceful shutdown (a second signal forces an immediate exit), a SIGUSR2 to print process stats, and a SIGHUP to short-circuit the client reconnect timer
Version: X.Y.Z
Read more: https://github.com/jpillora/chisel
<!--/tmpl-->
<!--tmpl,code=plain:echo "$ chisel client --help" && go run main.go client --help | sed 's#0.0.0-src (go1\..*)#X.Y.Z#' -->``` plain
$ chisel client --help
Usage: chisel client [options] <server> <remote> [remote] [remote] ...
<server> is the URL to the chisel server.
<remote>s are remote connections tunneled through the server, each of
which come in the form:
<local-host>:<local-port>:<remote-host>:<remote-port>/<protocol>
■ local-host defaults to 0.0.0.0 (all interfaces).
■ local-port defaults to remote-port.
■ remote-port is required*.
■ remote-host defaults to 127.0.0.1 (server localhost).
■ protocol defaults to tcp.
which shares <remote-host>:<remote-port> from the server to the client
as <local-host>:<local-port>, or:
R:<local-interface>:<local-port>:<remote-host>:<remote-port>/<protocol>
which does reverse port forwarding, sharing <remote-host>:<remote-port>
from the client to the server's <local-interface>:<local-port>.
example remotes
3000
example.com:3000
3000:google.com:80
192.168.0.5:3000:google.com:80
socks
5000:socks
R:2222:localhost:22
R:socks
R:5000:socks
stdio:example.com:22
1.1.1.1:53/udp
When the chisel server has --socks5 enabled, remotes can
specify "socks" in place of remote-host and remote-port.
The default local host and port for a "socks" remote is
127.0.0.1:1080. Connections to this remote will terminate
at the server's internal SOCKS5 proxy. When the server also
has --authfile set, SOCKS5 access requires an entry matching
the token "socks" in the user's address list.
When the chisel server has --reverse enabled, remotes can
be prefixed with R to denote that they are reversed. That
is, the server will listen and accept connections, and they
will be proxied through the client which specified the remote.
Reverse remotes specifying "R:socks" will listen on the server's
default socks port (1080) and terminate the connection at the
client's internal SOCKS5 proxy.
When stdio is used as local-host, the tunnel will connect standard
input/output of this program with the remote. This is useful when
combined with ssh ProxyCommand. You can use
ssh -o ProxyCommand='chisel client chiselserver stdio:%h:%p' \
[email protected]
to connect to an SSH server through the tunnel.
Options:
--fingerprint, A *strongly recommended* fingerprint string
to perform host-key validation against the server's public key.
Fingerprint mismatches will close the connection.
Fingerprints are generated by hashing the ECDSA public key using
SHA256 and encoding the result in base64.
Fingerprints must be 44 characters containing a trailing equals (=).
Legacy MD5 colon fingerprints (deprecated) are still accepted,
but only in their full 16-octet form; truncated prefixes are
rejected.
--auth, An optional username and password (client authentication)
in the form: "<user>:<pass>". These credentials are compared to
the credentials inside the server's --authfile. defaults to the
AUTH environment variable.
--keepalive, An optional keepalive interval. Since the underlying
transport is HTTP, in many instances we'll be traversing through
proxies, often these proxies will close idle connections. You must
specify a time with a unit, for example '5s' or '2m'. Defaults
to '25s' (set to 0s to disable).
--max-retry-count, Maximum number of times to retry before exiting.
Defaults to unlimited.
--min-retry-interval, Minimum wait time before retrying after a
disconnection. Defaults to 1 second.
--max-retry-interval, Maximum wait time before retrying after a
disconnection. Defaults to 5 minutes.
--proxy, An optional HTTP CONNECT or SOCKS5 proxy which will be
used to reach the chisel server. Authentication can be specified
inside the URL. Credentials must be URL-encoded; for example a
"#" in the password must be written as "%23".
For example, http://admin:[email protected]:8081
or: socks://admin:[email protected]:1080
The socks://, socks5:// and socks5h:// schemes are equivalent:
DNS is always resolved by the proxy.
--header, Set a custom header in the form "HeaderName: HeaderContent".
Can be used multiple times. (e.g --header "Foo: Bar" --header "Hello: World")
--hostname, Optionally set the 'Host' header (defaults to the host
found in the server url).
--sni, Override the ServerName when using TLS (defaults to the
hostname).
--tls-ca, An optional root certificate bundle used to verify the
chisel server. Only valid when connecting to the server with
"https" or "wss". By default, the operating system CAs will be used.
--tls-skip-verify, Skip server TLS certificate verification of
chain and host name (if TLS is used for transport connections to
server). If set, client accepts any TLS certificate presented by
the server and any host name in that certificate. This only affects
transport https (wss) connection. Chisel server's public key
may be still verified (see --fingerprint) after inner connection
is established.
--tls-key, a path to a PEM encoded private key used for client
authentication (mutual-TLS).
--tls-cert, a path to a PEM encoded certificate matching the provided
private key. The certificate must have client authentication
enabled (mutual-TLS).
--pid Generate pid file in current working directory
-v, Enable verbose logging
--help, This help text
Signals:
The chisel process is listening for:
a SIGINT or SIGTERM to begin a graceful shutdown
(a second signal forces an immediate exit),
a SIGUSR2 to print process stats, and
a SIGHUP to short-circuit the client reconnect timer
Version:
X.Y.Z
Read more:
https://github.com/jpillora/chisel
التشفير مفعّل دائمًا. عند تشغيل خادم chisel، سيُنشئ زوج مفاتيح ECDSA عام/خاص في الذاكرة. سيتم عرض بصمة المفتاح العام (SHA256 بترميز base64) عند بدء تشغيل الخادم. بدلاً من توليد مفتاح عشوائي، يمكن للخادم اختياريًا تحديد ملف مفتاح باستخدام خيار --keyfile. عند اتصال العملاء، سيعرضون أيضًا بصمة المفتاح العام للخادم. يمكن للعميل فرض بصمة معينة باستخدام خيار --fingerprint. لا تزال بصمات MD5 القديمة مقبولة ولكن يجب أن تكون بصيغة النقطتين الكاملة المكوّنة من 16 ثمانيًا — يتم رفض البادئات المقتطعة. راجع --help أعلاه لمزيد من المعلومات.
كما يحدّ الخادم من أحجام رسائل websocket الواردة قبل المصادقة (CHISEL_WS_READ_LIMIT، الافتراضي 512 كيبي بايت)، بحيث لا يمكن للأقران غير المصادقين استنزاف الذاكرة برسائل ضخمة الحجم. يقع الافتراضي بشكل مريح فوق الحد الأقصى لحزمة النقل البالغ 256 كيبي بايت في x/crypto/ssh، لذا لا يتم رفض أي حزمة SSH صالحة أبدًا. فقط القيمة 0 تعطّل الحد؛ والقيم السالبة تعود إلى الافتراضي الآمن.
باستخدام خيار --authfile، يمكن للخادم اختياريًا توفير ملف إعدادات user.json لإنشاء قائمة بالمستخدمين المقبولين. ثم يصادق العميل باستخدام خيار --auth. راجع users.json للحصول على مثال لملف إعدادات المصادقة. راجع --help أعلاه لمزيد من المعلومات.
ملاحظات حول سلوك ملف المصادقة:
^ و$ (يحذّر الخادم من الأنماط غير المثبتة عند التحميل). السلسلة الفارغة "" تطابق كل شيء.socks. تغيير جذري: كان SOCKS5 سابقًا يتجاوز ملف المصادقة بالكامل؛ يجب على الخوادم التي تعمل بـ --socks5 مع --authfile منح socks للمستخدمين الذين يجب أن يحتفظوا بوصول الوكيل (إدخالات البدل "" تستمر في العمل).user:pass) أصبحت الآن خطأ بدء تشغيل قاتل على كل من الخادم والعميل — كانت سابقًا تعطّل المصادقة بصمت.--auth من عمليات إعادة تحميل ملف المصادقة ويفوز في تعارضات الأسماء مع مستخدمي الملف.داخليًا، يتم ذلك باستخدام طريقة المصادقة Password التي يوفرها SSH. تعرّف على المزيد حول crypto/ssh هنا http://blog.gopheracademy.com/go-and-ssh/. يتم تسجيل فتح/إغلاق الجلسات (مع المستخدم وعنوان المصدر والبعيد) ومحاولات تسجيل الدخول الفاشلة على مستوى المعلومات.
أبسط إعداد آمن هو --tls-domain، الذي يوفّر شهادة LetsEncrypt تلقائيًا (يتطلب المنفذ 443 وسجل DNS يشير إلى الخادم):```sh
chisel server --port 443 --tls-domain chisel.example.com --auth user:pass
chisel client --auth user:pass https://chisel.example.com R:2222:localhost:22
لاستخدام شهادتك الخاصة (موقّعة ذاتيًا أو من مرجع مصادقة داخلي)، قم بإنشاء زوج مفتاح/شهادة ووجّه كلا الطرفين إلى الملفات الصحيحة:```sh
chisel server --port 443 --tls-key key.pem --tls-cert cert.pem
chisel client --tls-ca ca.pem https://chisel.example.com 3000
للاتصال المتبادل عبر TLS، مرّر أيضاً --tls-ca إلى الخادم و--tls-cert/--tls-key إلى كل عميل. لاحظ أن TLS يغلّف نقل chisel من الخارج؛ طبقة SSH الداخلية لا تزال تشفّر وتتحقق من الهوية، لذا يعمل التحقق من --fingerprint مع أو بدون TLS.
اطبع مفتاحاً خاصاً جديداً إلى الطرفية
chisel server --keygen -
# أو احفظه على القرص --keygen /path/to/mykey
شغّل خادم chisel الخاص بك
jpillora/chisel server --keyfile '<ck-base64 string or file path>' -p 9312 --socks5
اربط عميل chisel الخاص بك (باستخدام بصمة الخادم)
chisel client --fingerprint '<see server output>' <server-address>:9312 socks
وجّه عملاء SOCKS5 لديك (مثل نظام التشغيل/المتصفح) إلى:
<client-address>:1080
الآن لديك اتصال SOCKS5 مشفّر وموثّق عبر HTTP
ملاحظة: إذا كان الخادم يستخدم أيضاً --authfile، يحتاج المستخدمون إلى إدخال مطابق للرمز socks لاستخدام الوكيل (انظر المصادقة).
للسماح لعميل معيّن بالعمل كعقدة خروج SOCKS، امنحه عنوان مستمع SOCKS العكسي (R:socks يستمع على 127.0.0.1:1080 الخاص بالخادم):```json
{
"exituser:password": ["^R:127\.0\.0\.1:1080$"]
}
## 4.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2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.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.```sh
chisel server --reverse --authfile users.json
chisel client --auth exituser:password <server-address> R:socks
# server-side consumers point SOCKS5 clients at 127.0.0.1:1080,
# and their traffic exits via the chisel client's network
انظر أيضًا إلى مثال النفق العكسي خطوة بخطوة.
يعمل chisel عبر شبكات CDN التي تدعم WebSockets. بالنسبة لـ Cloudflare: فعّل WebSockets، ووكّل (السحابة البرتقالية) سجل DNS، واربط العملاء باستخدام https://. تُنهي CDN طبقة TLS، لكن طبقة SSH الداخلية تعني أن التحقق من --fingerprint لا يزال يوثّق خادم chisel الخاص بك من طرف إلى طرف — لا يمكن لـ CDN قراءة أو تعديل حركة المرور عبر النفق. أبقِ --keepalive على القيمة الافتراضية 25s للبقاء تحت حدود مهلة الخمول في CDN، ولاحظ أن الوكلاء الذين يزيلون ترويسات Upgrade لا يمكنهم حمل chisel إطلاقًا.
المقابض الأقل شيوعًا هي متغيرات البيئة، وكلها تُقرأ ببادئة CHISEL_ (مثل CHISEL_WS_TIMEOUT=10s):
| المتغير | الجانب | الافتراضي | الغرض |
|---|---|---|---|
WS_TIMEOUT | العميل | 45s | مهلة مصافحة websocket |
SSH_TIMEOUT | العميل | 30s | مهلة مصافحة ssh |
CONFIG_TIMEOUT | الخادم | 10s | انتظار طلب الإعداد من العميل |
SSH_WAIT | كليهما | 35s | المدة التي تنتظرها الأنفاق الجديدة لاتصال نشط |
PING_TIMEOUT | كليهما | فترة keepalive | مهلة الرد على ping keepalive (لا توجد pings إذا كان --keepalive 0) |
DIAL_TIMEOUT | عقدة الخروج | 30s | مهلة اتصال tcp لأهداف النفق |
WS_READ_LIMIT | كليهما | 524288 | الحد الأقصى لبايتات رسائل websocket الواردة (0 = بلا حد؛ سالب = الافتراضي) |
WS_BUFF_SIZE | كليهما | افتراضي Go | أحجام مخازن القراءة/الكتابة لـ websocket |
UDP_MAX_SIZE | كليهما | 9012 | الحد الأقصى لبايتات حزم udp |
UDP_DEADLINE | عقدة الخروج | 15s | مهلة قراءة تدفق udp وعمر الكنس الخامل |
UDP_MAX_CONNS | عقدة الخروج | 100 | الحد الأقصى لتدفقات udp المتزامنة لكل نفق |
SHUTDOWN_GRACE | الخادم | 5s | مدة تصريف طلبات http عند الإيقاف |
HOST وPORT وAUTH وCHISEL_KEY/CHISEL_KEY_FILE موثقة في نصوص --help أعلاه.
نظرًا لأن دعم WebSockets مطلوب:
github.com/jpillora/chisel/share يحتوي على الحزمة المشتركةgithub.com/jpillora/chisel/server يحتوي على حزمة الخادمgithub.com/jpillora/chisel/client يحتوي على حزمة العميل1.0 - الإصدار الأولي1.1 - استبدال التشفير المتماثل البسيط بـ ECDSA SSH1.2 - إضافة دعم SOCKS5 (الخادم) وHTTP CONNECT (العميل)1.3 - إضافة دعم الأنفاق العكسية1.4 - إضافة دعم ترويسات HTTP التعسفية1.5 - إضافة دعم SOCKS العكسي (بواسطة @aus)1.6 - إضافة دعم stdio للعميل (بواسطة @BoleynSu)1.7 - إضافة دعم UDP1.8 - الانتقال إلى صورة Docker scratch1.9 - الترقية إلى Go 1.21. التحول من بذرة --key إلى سلاسل مفاتيح P256 مع --key{gen,file} (بواسطة @cmenginnz)1.10 - الترقية إلى Go 1.22. إضافة .rpm و.deb و.apk إلى الإصدارات. إصلاح مقارنة الإصدارات المعطوبة.1.11 - الترقية إلى Go 1.25.1. تحديث جميع التبعيات.1.12 - مراجعة الموثوقية والأمان:
CHISEL_PING_TIMEOUT)، لذا تعيد الاتصالات الميتة الاتصال فورًا بعد النوم/الاستيقاظ، ومهلات NAT، وإعادة تشغيل الخادم--socks5 + --authfile، يتطلب الوصول إلى SOCKS5 الآن إدخال authfile يطابق socks (إدخالات wildcard "" تستمر في العمل)--fingerprint بصيغة SHA256 الكاملة (أو صيغة MD5 الكاملة المكونة من 16 ثمانية)--auth user) هي خطأ بدء تشغيل قاتل بدلاً من تعطيل المصادقة بصمتCHISEL_DIAL_TIMEOUT، الافتراضي 30s)CHISEL_SHUTDOWN_GRACE)؛ إشارة ثانية تفرض الخروجأربعة تغييرات قد تتطلب إجراءً عند الترقية من 1.11.x أو إصدار سابق:
--authfile (مُطبّق منذ v1.11.7): المستخدمون الذين يجب أن يحتفظوا بوصول الوكيل يحتاجون إدخال authfile يطابق الرمز socks (wildcard "" يستمر في العمل). انظر المصادقة. الطلبات المرفوضة تُسجل جانب الخادم كـ Denied connection to socks (ACL).--fingerprint: بصمات MD5 القديمة المقتطعة مرفوضة. استخدم بصمة SHA256 الكاملة التي يطبعها الخادم والعميل (صيغة MD5 الكاملة المكونة من 16 ثمانية ما زالت مقبولة، لكنها مهملة).--auth يجب أن تكون <user>:<pass> — السلاسل بدون نقطتين تفشل الآن عند بدء التشغيل بدلاً من تعطيل المصادقة بصمت.chisel client مع --max-retry-count يخرج الآن برمز غير صفري عند استنفاد محاولات الاتصال؛ النصوص البرمجية التي تفحص $? ووحدات systemd Restart=on-failure ستلاحظ ذلك.MIT © Jaime Pillora
CHISEL_UDP_MAX_CONNSCHISEL_WS_READ_LIMIT)--max-retry-count؛ جديد --min-retry-interval (الافتراضي 1s)؛ socks5:// مقبول لـ --proxygo install تُبلغ عن إصدارها الحقيقي؛ الجلسات وفشل تسجيل الدخول تُسجل بمستوى infox/crypto/ssh محدثة إلى v0.55.0 لمعالجة GO-2026-6303latest / X / X.Y