# اعمل على مشروع reverse proxy & tunnel سميته hafnium ويكتب بلغة rust

**URL:** <https://discourse.aosus.org/t/topic/1968>\
**Category:** البرامج والتطبيقات\
**Created:** [21 يونيو 2021، 8:26ص UTC](https://discourse.aosus.org/t/topic/1968 "2021-06-21T08:26:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xlmnxp](https://discourse.aosus.org/user_avatar/discourse.aosus.org/xlmnxp/32/8171_2.png) [@xlmnxp](https://discourse.aosus.org/u/xlmnxp)\
**Post date:** [21 يونيو 2021، 8:26ص UTC](https://discourse.aosus.org/t/topic/1968/1 "2021-06-21T08:26:49Z")

</div>

بسم الله الرحمن الرحيم, بدأت في البرنامج وسميته hafnium وهو معدن فلزي اكثر المعادن استقرار وأعلى تحمل للحرارة لدرجة يستخدم في المفاعلات النووية  
الاسم لسطر الأوامر يختصر إلى hf وهو اختصار للعنصر في الجدول الذري  
لماذا hafnium؟ الاسم يعطي الاستقرار للاداه وتحمل الضغط

تخطيط المشروع كتالي  
فكرة المشروع هي فتح منفذ لجهازك المحلي في خادم أخر دون المرور بجدار حماية أو NAT (الفكرة الساسية هي تخطي CGNAT)  
امر hf لسطر الاوامر  
يتبعه الأوامر التالية

```xml
hf genkey

```

يعطيك مفتاح public وprivate والعميل سيحتاج مفتاح public فقط علشان يتصل بالخادم

## في الخادم تتاح الاوامر التالية

```xml
hf allow <port> [tcp/udp]

```

السماح بفتح مفذ ميعن (افتراضيا جميعها مسموح فتحها الا اذا حدد منافذ معينة)

```xml
hf disallow <port> [tcp/udp]

```

يعطل امكانية الحصول على منفذ من جهة العميل

```xml
hf list [peers/ports]

```

يعرض المتصلين او المنافذ المفتوحة

```xml
hf disconnect [peer_public_key]

```

يفصل عميل

```xml
hf config [get/set] [key] [value]

```

يعدل اعدادات معينة مثال

```xml
$ hf config set listen_port 80
$ hf config get listen_port
80

```

## في جهة العميل

```xml
hf connect <ip_address>:<port> <public_key>

```

يتصل بالخادم ويولد مفتاح public وprivate للعميل

```xml
hf open <port> [tcp/udp]

```

يفتح منفذ في جهاز العميل للخادم

```xml
hf close <port> [tcp/udp]

```

يغلق منفذ

```xml
hf list [peers/port]

```

يعرض المنافذ والمتصلين

```xml
hf disconnect

```

يفصل الاتصال بالخادم

المشروع موجود في Github وساستخدم تخيص GPL او AGPL

> **[GitHub - xlmnxp/hafnium](https://github.com/xlmnxp/hafnium)**
>
> المساهمة في تطوير‎ xlmnxp/hafnium ‎من خلال إنشاء حساب على‎ GitHub.

---

<div class="post-metadata">

**Author:** ![saleh\_oukiki](https://discourse.aosus.org/user_avatar/discourse.aosus.org/saleh_oukiki/32/9996_2.png) [@saleh\_oukiki](https://discourse.aosus.org/u/saleh_oukiki)\
**Post date:** [21 يونيو 2021، 8:45ص UTC](https://discourse.aosus.org/t/topic/1968/2 "2021-06-21T08:45:58Z")

</div>

شكرا لك و المزيد من التطور للبرنامج في قادم الأيام إن شاء اللَّهُ.

---

<div class="post-metadata">

**Author:** ![xlmnxp](https://discourse.aosus.org/user_avatar/discourse.aosus.org/xlmnxp/32/8171_2.png) [@xlmnxp](https://discourse.aosus.org/u/xlmnxp)\
**Post date:** [21 يونيو 2021، 8:46ص UTC](https://discourse.aosus.org/t/topic/1968/3 "2021-06-21T08:46:27Z")

</div>

الفكرة مشابه لـ ngrok وlocaltunnel وchisel لكن ابسط  
ولا تتاثر بالفصل اما من العميل او الخادم ويعاد الاتصال مباشرة  
استخدم TCP مباشرة لتقليل وقت الاستجابة بقدر المستطاع وأضافه صلاحيات ونظام توثيق

---

<div class="post-metadata">

**Author:** ![AboTyim](https://discourse.aosus.org/user_avatar/discourse.aosus.org/abotyim/32/2754_2.png) [@AboTyim](https://discourse.aosus.org/u/AboTyim)\
**Post date:** [21 يونيو 2021، 8:54ص UTC](https://discourse.aosus.org/t/topic/1968/4 "2021-06-21T08:54:10Z")

</div>

وفقك الله، بانتظار المشروع على أحر من الجمر لتجربته.

---

<div class="post-metadata">

**Author:** ![islamux](https://discourse.aosus.org/user_avatar/discourse.aosus.org/islamux/32/3221_2.png) [@islamux](https://discourse.aosus.org/u/islamux)\
**Post date:** [4 فبراير 2022، 8:13ص UTC](https://discourse.aosus.org/t/topic/1968/5 "2022-02-04T08:13:19Z")

</div>

في الإنتظار

---

<div class="post-metadata">

**Author:** ![xlmnxp](https://discourse.aosus.org/user_avatar/discourse.aosus.org/xlmnxp/32/8171_2.png) [@xlmnxp](https://discourse.aosus.org/u/xlmnxp)\
**Post date:** [4 فبراير 2022، 2:53م UTC](https://discourse.aosus.org/t/topic/1968/6 "2022-02-04T14:53:15Z")

</div>

وجدت بدائل افضل بكثير مثل yggdrasil وايضًا  
[https://github.com/fatedier/frp](https://github.com/fatedier/frp)
