feat: add soaxreport tool for ECH testing via SOAX proxies#5
feat: add soaxreport tool for ECH testing via SOAX proxies#5
soaxreport tool for ECH testing via SOAX proxies#5Conversation
|
|
||
| // BuildProxyURL constructs an authenticated HTTPS proxy URL for a specific country and ISP. | ||
| // An optional sessionID can be provided for sticky sessions; if empty, a random one is generated. | ||
| func (c *Client) BuildProxyURL(countryISO, ispName, sessionID string) string { |
There was a problem hiding this comment.
Let's make it clearer it's not the SOCKS5 proxy URL
| func (c *Client) BuildProxyURL(countryISO, ispName, sessionID string) string { | |
| func (c *Client) BuildWebProxyURL(countryISO, ispName, sessionID string) string { |
| proxyUser := fmt.Sprintf("package-%s-country-%s-isp-%s-sessionid-%s-sessionlength-300", | ||
| c.cfg.PackageID, countryISO, ispName, sessionID) | ||
|
|
||
| return fmt.Sprintf("https://%s:%s@%s:%d", |
There was a problem hiding this comment.
Please do proper escaping. See https://github.com/OutlineFoundation/outline-sdk/blob/2fa02dc358d2e495b3880f93d274c3ffb417d1c9/x/soax/proxy.go#L84
| // ListISPs retrieves a list of available ISP operators for the specified country code. | ||
| // countryISO should be a 2-letter ISO country code (e.g., "US"). | ||
| func (c *Client) ListISPs(countryISO string) ([]string, error) { | ||
| url := fmt.Sprintf("https://api.soax.com/api/get-country-operators?api_key=%s&package_key=%s&country_iso=%s", |
There was a problem hiding this comment.
Use proper escaping. Or better: reuse the client in https://github.com/OutlineFoundation/outline-sdk/blob/main/x/soax/api.go
| return "UNKNOWN_ERROR" | ||
| } | ||
|
|
||
| var exitCodeNames = map[int]string{ |
There was a problem hiding this comment.
Please dedupe
ech-research/greasereport/main.go
Line 52 in 933d4dc
| } | ||
|
|
||
| // Args defines the execution parameters for a single curl run. | ||
| type Args struct { |
There was a problem hiding this comment.
I feel like we are adding a translation layer here that is not necessary.
You are writing the params in the Args language to then convert to curl language. One might as well write straight to curl language.
There's also a lot of duplication with
ech-research/greasereport/main.go
Line 139 in 933d4dc
I think we can extract runTest instead. Doesn't it work for both reports? That will also make it clearer that we are running the same test!
| "Virgin Islands, U.S.",VI | ||
| ``` | ||
|
|
||
| You can download a complete list of country codes from [here](https://raw.githubusercontent.com/datasets/country-list/master/data.csv). |
There was a problem hiding this comment.
Please fetch the list and add it to the workspace instead, like we do with the tranco list. To avoid mistakes and be reproducible.
| To run the tool, use the `go run` command from the project root directory: | ||
|
|
||
| ```sh | ||
| go run ./soaxreport --countries workspace/countries.csv --targetDomain www.google.com |
There was a problem hiding this comment.
We shouldn't need to specify the countries list like we do with the tranco list. Just read from the default location.
| This will: | ||
|
|
||
| 1. Load the SOAX credentials (`./workspace/soax/cred.json` by default) and country list. | ||
| 2. For each country, fetch the list of available ISPs. |
There was a problem hiding this comment.
Let's save the list of ISPs per country in a file.
| client := soax.NewClient(cfg) | ||
|
|
||
| // Load countries | ||
| if *countriesFlag == "" { |
There was a problem hiding this comment.
Make it read from the default location. And download if it's missing.
There was a problem hiding this comment.
Or perhaps we should just keep the data file in the repo!
| for _, country := range countries { | ||
| slog.Debug("Processing country", "name", country.Name, "code", country.Code) | ||
|
|
||
| isps, err := client.ListISPs(country.Code) |
There was a problem hiding this comment.
Please output the list of country -> ISPs to a file, for auditing.
| csvWriter := csv.NewWriter(outputFile) | ||
| defer csvWriter.Flush() | ||
|
|
||
| header := []string{ |
There was a problem hiding this comment.
Please fetch and output the exit node AS number and name. They are more universal than the SOAX IDs, so we should have both
Introduces a tool to test ECH GREASE compatibility globally using SOAX proxies. It measures performance and connectivity across different countries and ISPs.