First off, thank you for considering contributing to this project! Your help is greatly appreciated. This project is a community effort, and every contribution, no matter how small, is valuable.
This document provides guidelines for contributing to the project. Please read it carefully to ensure a smooth and effective contribution process.
There are several ways you can contribute to this project:
- Adding new proxy sources: This is the easiest and most common way to contribute.
- Adding new data transformers or parsers: If you find a proxy source with a unique data format, you can add the logic to process it.
- Improving the core application: Enhancing performance, fixing bugs, or adding new features.
- Reporting bugs or suggesting features: If you find an issue or have an idea for a new feature, please open an issue.
Even if you don't have time to contribute code, there are other ways you can support the project:
- Star our repository: A star is a great way to show your appreciation and helps increase the project's visibility.
- Share the repository: Share the project with your friends, colleagues, or on social media. The more people who know about it, the better!
- Ensure any install or build dependencies are removed before the end of the layer when doing a build.
- Update the
README.mdwith details of changes to the interface, this includes new environment variables, exposed ports, useful file locations, and container parameters. - Increase the version numbers in any examples and the
README.mdto the new version that this Pull Request would represent. The versioning scheme we use is SemVer. - You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
Unsure where to begin? A great way to start is by adding new proxy sources.
The core of this project is the collection of proxy sources. We are always looking for new, reliable sources of free proxies.
How it works:
The application reads files from the /sources directory. Each file in this directory (e.g., http.txt, vless.txt) corresponds to a proxy protocol. The content of these files are URLs, with each URL pointing to a list of proxies.
Steps to add a source:
- Find a proxy source URL. This should be a raw text URL that provides a list of proxies.
- Identify the correct file. In the
/sourcesdirectory, find the file that matches the protocol of your source list (e.g., for a list of HTTP proxies, usehttp.txt). If a file for that protocol doesn't exist, you can create one. - Add the URL. Add the URL to a new line in the appropriate file.
Advanced Source Configuration:
Sometimes, a source provides data in a non-standard format. Our application uses Transformers and Parsers to handle these cases. You can specify them in the source file on the same line as the URL, separated by commas.
URL Tokens:
You can use dynamic tokens in the source URLs to fetch lists that are generated based on the current date and time. The application will replace these tokens with the current values.
{YYYY}: Full year (e.g., 2023){MM}: Zero-padded month (e.g., 09){M}: Month (e.g., 9){DD}: Zero-padded day (e.g., 05){HH}: Zero-padded hour (e.g., 08){mm}: Zero-padded minute (e.g., 01){HH/N}: Hour rounded to the nearest increment of N. For example, if it's 14:00,{HH/6}would resolve to12. This is useful for sources that update at regular intervals (e.g., every 6 hours).
Format: url,transformer,parser
url: (Required) The URL of the proxy list.transformer: (Optional) Specifies how to transform the raw data before parsing. The default israw(no transformation). We also havebase64for sources encoded in Base64.parser: (Optional) Specifies how to parse individual lines from the source. The defaultParseProxyURLhandles standard proxy URLs. Other options includeColonURL(forip:portformats) andSpaceURL(forip portformats).
Example:
Let's say you have a source for SOCKS5 proxies at http://myproxies.com/list. The list is Base64 encoded, and each proxy is in the ip:port format. You would add the following line to sources/socks5.txt:
http://myproxies.com/list,base64,ColonURL
If a proxy source uses a unique encoding or format (e.g., Gzip, custom text format), you might need to add a new Transformer.
- Go to
internal/transformer.go. - Define a new function that matches the
Transformertype:func([]byte) []byte. This function will take the raw response body and return the transformed body. - Register your new transformer in the
init()function withininternal/transformer.go, giving it a name.
// In internal/transformer.go
func init() {
Transformers["base64"] = FromBase64
Transformers["myNewTransformer"] = MyNewTransformer // Add your transformer here
}
// Define your transformer function
func MyNewTransformer(buf []byte) []byte {
// ... your transformation logic ...
return transformedBuf
}If a source list has a unique structure for defining proxies that our existing parsers can't handle, you can add a new Parser.
- Go to
internal/parser.go. - Define a new function that matches the
Parsertype:func(string, string) (*Proxy, error). This function takes the protocol and a line of text and should return aProxyobject or an error. - Register your new parser in the
init()function withininternal/parser.go.
// In internal/parser.go
func init() {
Parsers["ColonURL"] = ParseColonURL
Parsers["myNewParser"] = MyNewParser // Add your parser here
}
// Define your parser function
func MyNewParser(proto, line string) (*Proxy, error) {
// ... your parsing logic ...
return proxy, nil
}This project uses standard Go formatting. Please run go fmt on your code before submitting a pull request. We also use a linter to ensure code quality.
Thank you for your contribution!