[GH-ISSUE #6269] [Feature]: درخواست اضافه شدن قابلیت محدودیت دستگاه بر اساس HWID #4254

Closed
opened 2026-10-31 20:38:19 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @qar4al on GitHub (Aug 20, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6269

یک پیشنهاد و درخواست مهم داشتم که می‌تواند سطح مدیریت کاربران را در پنل به شدت ارتقا دهد: پشتیبانی از HWID (شناسه سخت‌افزاری) برای محدود کردن اتصال کاربران.

در حال حاضر برای جلوگیری از اشتراک‌گذاری کانفیگ‌ها (سوءاستفاده کاربران)، اکثراً از محدودیت IP (IP Limit) استفاده می‌کنیم. اما با توجه به تغییر مداوم IP کاربران موبایل هنگام جابجایی بین دکل‌ها مخابراتی، محدودیت IP اغلب باعث مسدود شدن اشتباهی کاربران واقعی می‌شود و دردسرهای زیادی برای ادمین‌ها ایجاد می‌کند.

همانطور که می‌دانید، کلاینت‌های محبوبی مثل V2Box در حال حاضر قابلیتی دارند که موقع درخواست آپدیت سابسکریپشن، شناسه دستگاه را در قالب هدر X-HWID به سمت سرور می‌فرستند.
اگر پنل 3x-ui بتواند این هدر را دریافت، ذخیره و مدیریت کند، ما می‌توانیم مشخص کنیم که هر کاربر دقیقاً روی چند دستگاه مجاز به استفاده از لینک است (مثلاً فقط ۲ دستگاه سخت‌افزاری ثبت شده).

اضافه شدن این فیچر، 3x-ui را کامل‌تر کرده و یکی از بزرگترین دغدغه‌های ادمین‌ها را برطرف می‌کند. امیدوارم این مورد را در برنامه‌های توسعه آینده (Roadmap) قرار دهید.
ممنون بابت وقت و انرژی که می‌گذارید.

Image

Describe the solution you'd like

UI Placement:

  • On the "Add/Edit Client" modal, add a new input field called Max Devices (integer) right next to the IP Limit field.
  • Add a "Reset HWID" button in the client's action menu to allow admins to easily clear a user's registered devices if they buy a new phone.

Expected Behavior & Backend Logic:

  • When a client app (like V2Box) requests a subscription link, it sends an X-HWID header.
  • The 3x-ui backend should capture this header.
  • If the user has Max Devices set to 2, the panel will save the first two unique HWIDs that request the subscription.
  • Edge Case: If a 3rd unknown HWID tries to update the subscription, the backend should return an empty response or a 403 Forbidden error, preventing the new device from getting the config nodes.
  • (Optional but ideal) If Xray-core allows checking this during the actual connection protocol, block the connection. Otherwise, enforcing this strictly at the subscription URL level is a great start.

Database:

  • Introduce a new column in the client database to store an array of bound HWID strings.

Currently, we rely on the IP Limit feature. However, this falls short because mobile networks frequently change IPs (especially with CGNAT). This causes innocent users to get blocked automatically, forcing admins to constantly unblock them. IP Limiting does not truly identify the device, whereas HWID would solve this permanently.

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @qar4al on GitHub (Aug 20, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6269 ### Is your feature request related to a problem? یک پیشنهاد و درخواست مهم داشتم که می‌تواند سطح مدیریت کاربران را در پنل به شدت ارتقا دهد: پشتیبانی از HWID (شناسه سخت‌افزاری) برای محدود کردن اتصال کاربران. در حال حاضر برای جلوگیری از اشتراک‌گذاری کانفیگ‌ها (سوءاستفاده کاربران)، اکثراً از محدودیت IP (IP Limit) استفاده می‌کنیم. اما با توجه به تغییر مداوم IP کاربران موبایل هنگام جابجایی بین دکل‌ها مخابراتی، محدودیت IP اغلب باعث مسدود شدن اشتباهی کاربران واقعی می‌شود و دردسرهای زیادی برای ادمین‌ها ایجاد می‌کند. همانطور که می‌دانید، کلاینت‌های محبوبی مثل V2Box در حال حاضر قابلیتی دارند که موقع درخواست آپدیت سابسکریپشن، شناسه دستگاه را در قالب هدر X-HWID به سمت سرور می‌فرستند. اگر پنل 3x-ui بتواند این هدر را دریافت، ذخیره و مدیریت کند، ما می‌توانیم مشخص کنیم که هر کاربر دقیقاً روی چند دستگاه مجاز به استفاده از لینک است (مثلاً فقط ۲ دستگاه سخت‌افزاری ثبت شده). اضافه شدن این فیچر، 3x-ui را کامل‌تر کرده و یکی از بزرگترین دغدغه‌های ادمین‌ها را برطرف می‌کند. امیدوارم این مورد را در برنامه‌های توسعه آینده (Roadmap) قرار دهید. ممنون بابت وقت و انرژی که می‌گذارید. <img width="1080" height="2400" alt="Image" src="https://github.com/user-attachments/assets/bb45433e-9e59-4f54-8871-7a514e695a69" /> ### Describe the solution you'd like **UI Placement:** - On the "Add/Edit Client" modal, add a new input field called `Max Devices` (integer) right next to the IP Limit field. - Add a "Reset HWID" button in the client's action menu to allow admins to easily clear a user's registered devices if they buy a new phone. **Expected Behavior & Backend Logic:** - When a client app (like V2Box) requests a subscription link, it sends an `X-HWID` header. - The 3x-ui backend should capture this header. - If the user has `Max Devices` set to `2`, the panel will save the first two unique HWIDs that request the subscription. - **Edge Case:** If a 3rd unknown HWID tries to update the subscription, the backend should return an empty response or a 403 Forbidden error, preventing the new device from getting the config nodes. - (Optional but ideal) If Xray-core allows checking this during the actual connection protocol, block the connection. Otherwise, enforcing this strictly at the subscription URL level is a great start. **Database:** - Introduce a new column in the client database to store an array of bound HWID strings. Currently, we rely on the `IP Limit` feature. However, this falls short because mobile networks frequently change IPs (especially with CGNAT). This causes innocent users to get blocked automatically, forcing admins to constantly unblock them. IP Limiting does not truly identify the device, whereas HWID would solve this permanently. ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:38:19 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4254
No description provided.