[GH-ISSUE #323] Network Condition: Network Logic #3 #324

Open
opened 2026-03-03 19:49:52 +03:00 by kerem · 2 comments
Owner

Originally created by @NghiaTranUIT on GitHub (Oct 30, 2023).
Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/323

Originally assigned to: @kics223w1 on GitHub.

Description

It's time to implement the Network Condition. It's quite tricky because I haven't found any reliable npm package (with a high download number and active maintenance).

Some examples (not reliable):

Acceptance Criteria

  • Find a npm package that can help implement the Network Condition

  • Or read some code and bring it Proxyman (e.g toxy library)

  • Implement the logic to simulate: Upload = Client -> Proxyman -> Server. Download = Server -> Proxyman -> Client

  • Download Bandwidth

  • Download Package Drop Rate

  • Download delay (latency)

  • Upload Bandwidth

  • Upload Package Drop Rate

  • Upload delay (latency)

NOTE

  • If a connection is matched with a Network Condition Rule -> It should be handled by the Network Condition.
  • Other connections (don't match the network) -> It works as normal.
  • If the Wide-System rule is activated -> ALL traffic is affected
Originally created by @NghiaTranUIT on GitHub (Oct 30, 2023). Original GitHub issue: https://github.com/ProxymanApp/proxyman-windows-linux/issues/323 Originally assigned to: @kics223w1 on GitHub. ## Description It's time to implement the Network Condition. It's quite tricky because I haven't found any reliable npm package (with a high download number and active maintenance). Some examples (not reliable): - https://github.com/bcoe/crapify - https://github.com/derhuerst/simulate-network-conditions - https://github.com/h2non/toxy/tree/master/lib/poisons (We can read this code and reuse it on Proxyman) ## Acceptance Criteria - [x] Find a npm package that can help implement the Network Condition - [x] Or read some code and bring it Proxyman (e.g toxy library) - Implement the logic to simulate: Upload = `Client -> Proxyman -> Server`. Download = `Server -> Proxyman -> Client` - [x] Download [Bandwidth](https://github.com/h2non/toxy/blob/master/lib/poisons/bandwidth.js) - [x] Download Package Drop Rate - [x] Download [delay (latency)](https://github.com/h2non/toxy/blob/master/lib/poisons/latency.js) - [x] Upload [Bandwidth](https://github.com/h2non/toxy/blob/master/lib/poisons/bandwidth.js) - [x] Upload Package Drop Rate - [x] Upload [delay (latency)](https://github.com/h2non/toxy/blob/master/lib/poisons/latency.js) ### NOTE - If a connection is matched with a Network Condition Rule -> It should be handled by the Network Condition. - Other connections (don't match the network) -> It works as normal. - If the Wide-System rule is activated -> ALL traffic is affected
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 30, 2023):

How to test:

Case 1: Happy Case

  1. Create a new Network Condition Rule -> Tick System-Wide -> Select 4G profile
  2. Open https://fast.com/ and confirm that Bandwidth matches with 4G profile
  3. Open Youtube or some website -> Notice the internet speed is slow as intended
  4. Repeat with 3G profile and confirm the speed is slower
  5. Disable the Rule or Tool
  6. Confirm all network backs to normal

Case 2: Enable 1 rule

  1. Create a new Network Condition Rule -> Host = fast.com -> Select 4G profile
  2. Open https://fast.com/ and confirm that Bandwidth matches with 4G profile
  3. Open https://www.speedtest.net/ -> Confirm it has full speed because we only apply Network Condition to fast.com
  4. Open Rule view -> Disable it
  5. Confirm fast.com runs as normal speed.
<!-- gh-comment-id:1784442723 --> @NghiaTranUIT commented on GitHub (Oct 30, 2023): ### How to test: #### Case 1: Happy Case 1. Create a new Network Condition Rule -> Tick `System-Wide` -> Select 4G profile 2. Open https://fast.com/ and confirm that Bandwidth matches with 4G profile 3. Open Youtube or some website -> Notice the internet speed is slow as intended 4. Repeat with 3G profile and confirm the speed is slower 5. Disable the Rule or Tool 6. Confirm all network backs to normal #### Case 2: Enable 1 rule 1. Create a new Network Condition Rule -> Host = `fast.com` -> Select 4G profile 2. Open https://fast.com/ and confirm that Bandwidth matches with 4G profile 3. Open `https://www.speedtest.net/` -> Confirm it has full speed because we only apply Network Condition to `fast.com` 4. Open Rule view -> Disable it 5. Confirm fast.com runs as normal speed.
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 30, 2023):

Case 3: 100% loss

  1. Create a new Network Condition Rule -> Wide-System rule -> Select 100% loss
  2. Open any website -> Confirm all connections are waiting forever -> It doesn't close the connection.
  3. Open Rule view -> Disable it
  4. Confirm all websites just works fine
<!-- gh-comment-id:1784544004 --> @NghiaTranUIT commented on GitHub (Oct 30, 2023): #### Case 3: 100% loss 1. Create a new Network Condition Rule -> Wide-System rule -> Select `100% loss` 2. Open any website -> Confirm all connections are waiting forever -> It doesn't close the connection. 4. Open Rule view -> Disable it 5. Confirm all websites just works fine
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
starred/proxyman-windows-linux#324
No description provided.