README
¶
Pxier -- Simple but powerful free proxy API server
Pxier is an API server based on multiple source of proxy providers, and it's built with Echo, using a MySQL database to store all the data.It also provider a report api for user to report a dead proxy, therefore Pxier could improve the quality in real-time
Pxier's source code is so simply that you can easily fork or pull request. It's designed to keep everything simple.
-- It just a proxy scraper, why bother doing those fascinating abstraction stuff?
Introduction
Pxier is built with four component:
pxier_fetcher: pxier_fetcherpxier_maintainer(optional): pxier_maintainerpxier_web: pxier_webpxier_db_syncer: pxier_db_syncer
These component's relationship is shown by image below.
Here's Pxier's database development:
- At very early version, Pxier use one single pure mysql database, and soon the performance issue came out: When large amount of read&write requests and 10K+ proxies stored, CPU usage will hugely increase.
- After that, Pxier adds cache to the mysql, it's stored as a
Mapin memory, and sync to database every X seconds.This method hugely lower the CPU usage(100%@10K proxies to 30~60%@30K proxies), but cpu will stillspike to the peakwhen inserting new proxies, delete dead proxy etc. - Finally, Pxier choose to divide the database to two different part:
WriteDBandReadDB, whereWriteDBis the master, and has the most up-to-date data,ReadDBis the slave, it will sync fromWriteDBevery X seconds. For read Pxier will only query theReadDB, and for write such as report error proxy, insert new proxy, remove dead proxy, will write theWriteDB. DB syncing is achieved bypxier-db-syncer
The reason not using mysql's replication is to easier deploy in docker. And divide read and write make Pxier much faster and less cpu load
Before start using Pxier
- Pxier only collect proxies, what you plan to do with Pxier is your freedom, not Pxier's business, nor responsible to Pxier
- Pxier is designed to provider an all-in-one solution, for those who being scraped and feel offended, please open an issue, and I'll delete your source right away
- Pixer is an individual project, since it's a scraper, it needs feedback to fix bugs, and more validated source for more "All-In-One"
- Pixer is an individual project, means that I may have no much time for fixing bug, develop more feature, so if you want to get more cool stuff, welcome to contribute or fork then do it yourself
- Pixer is an open source and free project, you're welcome to use, modify, publish your version. But since I don't know that deep about open source license and don't want to spend time for it, I think just put my words here is good enough: If you planned to publish your own fork version, please name the origin author. If you planned to use in a commercial project, you MUST contact me first and MUST NOT use it before I agree.
From Docker-Compose
- download docker-compose-example.yml and rename it to
docker-compose.yml - edit your own setting in
docker-compose.yml - deploy your compose
Build yourself
For every component you will need to do these:
git clone the repo- cd into the saved directory
go mod tidy && go mod vendor && go build -o pixer./pixer
Documentation
¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.