PHP in Windows combined with bat batch processing to achieve verification proxy IP server function
1、 Capture and verify proxy through curl of PHP
Second, multi process processing through bat
Third, merge the results of multi process processing
PHP in Windows combined with bat batch processing to achieve verification proxy IP server function
due to business, proxy server is needed. There are many sites providing proxy server information on the Internet, so you can get information from these sites. However, due to the network or other reasons, some of the obtained IP is inaccessible, so we need to do verification filtering to get the proxy server that can be used.
1、 Capture and verify proxy through curl of PHP
grab with curl
thinking
1. Curl grabs website content;
2. Simple_ html_ DOM (click to download) parses the captured content, parses the key information, and saves the file (or cache);
3. Perform curl verification on the key information (IP and port of proxy server);
4. Verification is divided into HTTPS and HTTP methods, which should be distinguished.
2、 Multi process processing by bat
thinking
1. A single CMD window can run a php.exe Process, multiple processes can run multiple processes;
2. Modify the PHP program, support the parameter transfer of CLI mode, different website links can be captured through different parameters;
3. Run multiple CMDS through the start command (view the description), and use & amp; Connect, make main.bat File;
4 main.bat The running status of other CMD windows can be monitored in the file, which can be obtained in the tasklist by setting the title of the CMD;
5. After the running of other CMD windows (PHP tasks) is completed, the result set is merged.
3、 Merging the results of multiprocessing
take out the file saved in the first step, and then merge the result with PHP code, and output it to result_ xxx.json It can be done in the middle;
The code will not be posted for the time being. It will be updated later.
Read More:
- Running bat batch file in background
- Windows batch: File running in the background
- Processing method of eslint verification error
- When configuring the proxy with Vue, the front-end requests the server-side error 504; the Vue console reports the error occurred while trying to proxy request
- Exception in thread “main“ java.lang.ClassCastException: com.sun.proxy.$Proxy8 cannot be cast to XXX
- Java docking PayPal to achieve automatic renewal function
- Solve the problem of Python in Windows environment: Fatal error in launcher: Unable to create process using’”‘ in pip installation
- In windows, “cmake” is not an internal or external command, nor a runnable program or batch file.
- An idea to solve Warning move_uploaded_file, failed to open stream in the process of php uploading files
- PHP function file_ get_ Contents() reports an error when using HTTPS protocol: SSL operation failed
- PHP & nbsp; built in server array
- Resolve the problem of “event ID 4107” or “event ID 11” errors recorded in the application logs of windows and windows server
- PHP Fatal error: Call to a member function query() on a non-object in
- Due to multi process — pychar debug breakpoint debugging encounter pychar dataloader will be stuck
- [Python error] using PIP / easy under Windows_ Fail error in launcher: unable to create process using
- Winsw throws an exception “error 1067: unexpected process termination” when converting Java application to Windows Service
- Windows batch script opens hosts
- Batch delete process
- To solve the problem in Windows opencv installation: error configuration process, project files may be invalid
- IOS WebView failed to load the web page. Error domain = kcferrodomaincfnetwork code = 310 “there was a problem communicating with the secure web proxy server (HTTPS). “