bepass-org/smartSNI
소개
Go로 작성된 간단한 단일 파일 스마트 SNI 프록시로, DoH와 DoT를 지원합니다.
시스템 및 인프라What you can do
- DNS-over-HTTPS (DoH): Accepts and processes DNS queries over HTTPS.
- DNS-over-TLS (DoT): Accepts and processes DNS queries over TLS.
- Rate Limiting: Throttles the number of requests using a limiter.
- Custom Domain Handling: Matches DNS queries to a list of specified domains and returns corresponding IP addresses.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalSmart SNI and DNS Proxy Server
This DNS Proxy Server is a Go-based server capable of handling both DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) requests. It features rate limiting and can process DNS queries based on a custom JSON configuration file.
Features
- DNS-over-HTTPS (DoH): Accepts and processes DNS queries over HTTPS.
- DNS-over-TLS (DoT): Accepts and processes DNS queries over TLS.
- Rate Limiting: Throttles the number of requests using a limiter.
- Custom Domain Handling: Matches DNS queries to a list of specified domains and returns corresponding IP addresses.
- SNI Proxy: Proxies non-matching domains to their respective addresses.
- Configurable: Uses a
config.jsonfile to define behavior for specified domains.
Configuration
The server uses a config.json file which should be structured as follows:
{
"host": "your.host.com",
"domains": {
"example.com": "1.2.3.4",
"anotherdomain.com": "1.2.3.4"
}
}
Replace the IP addresses with your server's public IP to ensure transparent proxying(Here it's 1.2.3.4).
You can use this code to proxy all domains(its not recommended)
{
"host": "your.host.com",
"domains": {
".": "1.2.3.4"
}
}
TLS Certificates
The DoT and DOH servers expect TLS certificates to be located at /etc/letsencrypt/live/your.host.com/. Make sure you have valid certificates named fullchain.pem and privkey.pem.
You can obtain a valid certificate for your domain with lets encrypt
Auto Install
bash <(curl -fsSL https://raw.githubusercontent.com/bepass-org/smartSNI/main/install.sh)
Manual Setup
- Install Requirements
apt update
apt install nginx certbot python3-certbot-nginx
snap install go --classic
- Change server_name in /etc/nginx/sites-enabled/default to your
domain - Obtain a valid certificate for nginx
certbot --nginx -d <YOUR_DOMAIN>
- Clone the repository to your local machine.
- Create and configure your
config.jsonfile. - Run
go buildto compile the server. - Run the compiled binary to start the server in tmux or in background with nohup.
./name-of-compiled-binary
Rate Limiting
The server uses the golang.org/x/time/rate package to implement rate limiting. You can adjust the rate limiter in the main function to suit your needs.
Contributions
Contributions to this project are welcome. Please fork the repository, make your changes, and submit a pull request.
Credits
Special thanks to Peyman for auto install script
License
This project is open-source and available under the MIT License.
관련 프로젝트 살펴보기
불러오는 중…