Home

Awesome

Wehe Command Line Client

This is the Wehe command line client. This app runs tests to help users determine whether their ISPs are throttling network traffic for certain apps or ports. Please see https://wehe.meddle.mobi/ for more details.

There are two ways to run the code:

  1. Run the jar file (wehe-cmdline.jar)
  2. Build from source (use Java 17)

About the Code

Build jar with Maven

This source code contains pom.xml file with the configuration and dependencies needed to build the jar file.

To build the jar file, simply execute: mvn package.

Run the jar

A compiled jar comes with the repo (wehe-cmdline.jar). This jar was compiled using Java 17. To run this jar, it must be in the same directory as the res/ directory.

Certificates

If using this client with different certificates than the production certificates, replace res/main with the proper PEM certificate.

Usage

Usage: java -jar wehe-cmdline.jar -n <TEST_NAME> [OPTION]...

Example: java -jar wehe-cmdline.jar -n applemusic -c -r results/ -l info

Options

-n TEST_NAME - The name of the test to run. Argument required. See below for list of test names.

-s SERV_NAME - The hostname or IP of server to run the tests. Default: wehe4.meddle.mobi.

-m MLAB_API - The URL of the API to retrieve access envelopes to run tests on M-Lab servers. Default: https://locate.measurementlab.net/v2/nearest/wehe/replay.

-u MUM_SRVR - The number of servers to run the test concurrently. This feature is available only with M-Lab servers. Must be integer between 1 and 4 inclusive. Default: 1.

-c - Turn off confirmation replays (if test is inconclusive, it will automatically rerun by default).

-a A_THRESH - The area threshold percentage for determining differentiation. Default: 50.

-k KS2P_VAL - The KS2P-value threshold percentage for determining differentiation. Default: 1.

-t RESR_ROOT - The resources root containing apps_list.json and the tests. No need to change this if using the jar or if you don't move the res/ directory. Default: res/.

-r RSLT_ROOT - The results root containing the output logs and info. Default: test_results/.

-l LOG_LEVEL - The level of logs and above that should be printed to console (all levels will be saved to logs on disk regardless of the level printed to console). Choose from wtf, error, warn, info, or debug. Default: none of these, only UI logs (what the user would see on screen when running the Android app) will be printed to the console.

-h - Print the help message.

-v - Print the version number.

Tests

App NameTest Name (-n arg)Port NameTest Name (-n arg)
Amazon Prime Videoamazon80 HTTP smallport80s
Apple Musicapplemusic81 HTTP smallport81s
Dailymotiondailymotion465 SMTPS smallport465s
Deezerdeezer853 DoT smallport853s
Discorddiscord993 IMAPS smallport993s
Disney+disneyplus995 POP3S smallport995s
ESPNespn1194 OpenVPN smallport1194s
Facebookfacebook1701 L2TP smallport1701s
Google Meetmeet5061 SIPS smallport5061s
Huluhulu6881 BitTorrent smallport6881s
Instagraminstagram8080 SpeedTest smallport8080s
Maxmax8443 SpeedTest smallport8443s
Microsoft Teamsteams80 HTTPS largeport80l
NBC Sportsnbcsports81 HTTP largeport81l
Netflixnetflix465 SMTPS largeport465l
Molotov TVmolotovtv853 DoT largeport853l
myCANALmycanal993 IMAPS largeport993l
OCSocs995 POP3S largeport995l
Pandorapandora1194 OpenVPN largeport1194l
Saltosalto1701 L2TP largeport1701l
SFR Playsfrplay5061 SIPS largeport5061l
Skypeskype6881 BitTorrent largeport6881l
Snapchatsnapchat8080 SpeedTest largeport8080l
Spotifyspotify8443 SpeedTest largeport8443l
TikToktiktok
Twitchtwitch
Vimeovimeo
Webexwebex
WhatsAppwhatsapp
Xx
YouTubeyoutube
Zoomzoom

Note: Small port tests are 10 MB per replay, while large port tests are 50 MB per replay.

Output

Output is contained in RSLT_ROOT:

Exit Codes

Each error exit code corresponds to a specific spot in the code where execution of the tests was terminated. CTRL+F the exit status on the code base to find where each of these locations are located.

Exit CodeExit StatusExplanation
0SUCCESSNo errors occurred during the test.
1ERR_GENERALAn error occurred that does not fit any below.
2ERR_CMDLINEInvalid command line input.
3ERR_INFO_RDError reading from info.txt.
4ERR_INFO_WRError writing to info.txt.
5ERR_WR_LOGSError writing to the logs.
6ERR_CONN_IPError connecting to server because IP not found.
7ERR_CONN_INSTError getting instance of TCP or UDP socket to send data.
8ERR_CONN_IO_SERVIO issue with the SideChannel.
9ERR_CONN_WSError connecting to WebSocket.
10ERR_UNK_HOSTError connecting to the server.
11ERR_UNK_META_HOSTError connecting to metadata server.
12ERR_CERTError with the certificates.
13ERR_NO_IDNo random ID found.
14ERR_NO_TESTTest not found on client.
15ERR_PERM_REPLAYTest not found on server.
16ERR_PERM_IPAnother user with the same IP is running tests on the server.
17ERR_PERM_RESServer is low on resources.
18ERR_PERM_UNKUnknown server error.
19ERR_ANA_NULLNo analysis status returned.
20ERR_ANA_NO_SUCAnalysis did not succeed.
21ERR_ANA_HIST_CTInvalid analysis history count.
22ERR_RSLT_NULLNo result status returned.
23ERR_RSLT_NO_RESPResult succeed, but result was not sent.
24ERR_RSLT_NO_SUCResult not found.
25ERR_RSLT_ID_HCResult returned wrong random ID or history count.
26ERR_BAD_JSONJSON error.

NOTE: If the Exit Code is negative, then two errors occurred: the number in the Exit Code and ERR_WR_LOGS. For example, -24 means no result was found and the logs could not be written to disk.