The official introduction

Zan Proxy is an HTTP Proxy server written in Node.js that can be used to modify request addresses and simulate response data. It is also a tool for customizing DNS resolution and request monitoring. The proxy server has a user-friendly interface and is easy to use. We also provide advanced plug-in mechanisms for developers to customize proxy behavior.

Github

Github.com/youzan/zan-…


Main Functions and Features

Free to forward

Connect the online environment to the local computer

In both online and pre-delivery environments, resource requests (JS/CSS) and interface requests can be easily forwarded to the local computer to achieve the effect of debugging online pages with the local computer. Supports HTTPS, WebSocket, and sharing of forwarding rules.

Rules of synchronous

Step by step to create team business exclusive rules

Manual synchronization is not required. The remote rule function is used to synchronize online rules to team members to ensure the unity of rules within the team.

One-click second cut to Host

No browser cache

No need to change the host file, no browser cache, DNS resolution one-key modification, easy to solve the developer’s environment switch problem

Mock interface data

Parallel development is more efficient

You can debug without waiting for interface development to complete, reducing unnecessary waiting times, and the Mock data interface makes parallel development possible. It can also be forwarded to third-party mock data platforms through plug-in extensions.

Agent monitoring

Request response at a glance

Monitor all requests through ZanProxy, support mobile terminal request capture, provide development experience

Support custom plug-ins

Flexible extend

You can customize the agent behavior using custom plug-ins to meet the requirements of customized agents in various scenarios

Install the configuration

The author’s environment is Windows, because the official document just does not have a detailed introduction, so let’s install and configure in Windows together, and I believe it is not a problem on Linux

  • Environment premise

First you need to install NPM, you need to use NPM to install, I’m assuming you already have NPM installed

yarn global add zan-proxy
# npm i -g zan-proxy
Copy the code

Check after installation

zan-proxy --version
Copy the code
  • Install openssl

One of the minor complications of installing ZanProxy on Windows is installing OpenSSL. There are many tutorials on the web. In this article, it will be very simple, and the software used will be packaged and shared later as win64OpenSSL-1_1_1g

After the OpenSSL installation is complete, configure the bin folder in the installation directory to system environment variables

This method is a much simpler method I have seen than many online tutorials, you can refer to

  • Start the ZanProxy

Once the installation is complete, you can start ZanProxy

zan-proxy
Copy the code

If successful, the browser is opened by default

  • The startup parameters are configurable

Specify proxy port

    zan-proxy -p 8002
Copy the code

Specifies the management server port

    zan-proxy -u 40002
Copy the code

View all commands

    zan-proxy -h
Copy the code

You can configure according to their own needs, the above is the installation process, next to configure the certificate, used for remote debugging, certificate file I will put in the link, the document is under Mac, the author is under Windows, installation is roughly similar

The above is debuggable under Windows, please refer to the official document for Android, and then a simple configuration is required to fully use it. It is recommended to install the Chrome plug-in SwitchyOmega, which I will also put in the link. The purpose of SwitchyOmega is to make proxy switching very convenient

Use in the browser

The browser is the same whether it is running on Windows or MacOS or Linux. First, start ZanProxy. The default proxy port is 8001

  • Configuration SwitchyOmega

Create a new scenario mode, then use HTTP proxy, port 8001, LAN IP can be configured under the LAN, as shown in the picture below, and select this scenario on the page you need to debug

Request to monitor

conclusion

The use of specific to point you can see the document, this article mainly explain the installation or part, of which the Host management, Http forwarding, Mock and plug-in parts we can follow one’s inclinations, document is very detailed, if you want to debug the request on the phone, you can install the certificate after configuration agent for remote debugging, is very simple, and enjoy it!

Coder