Admin GUI
Pipy comes with a built-in visual Web development environment, including an editor and graphical aided design tools to simplify script development and debugging.
Start Admin Console
Starting console is pretty straight-forward, as introduced in Pipy CLI you can configure listening port to your specified needs by passing the --admin-port command line argument.
$ pipy --admin-port=6060 tutorial/03-proxy/proxy.js2022-02-16 14:44:22.042 [INF] [config]2022-02-16 14:44:22.042 [INF] [config] Module /proxy.js2022-02-16 14:44:22.042 [INF] [config] ================2022-02-16 14:44:22.042 [INF] [config]2022-02-16 14:44:22.042 [INF] [config] [Listen on 8000 at 0.0.0.0]2022-02-16 14:44:22.042 [INF] [config] ----->|2022-02-16 14:44:22.042 [INF] [config] |2022-02-16 14:44:22.042 [INF] [config] demuxHTTP2022-02-16 14:44:22.042 [INF] [config] |2022-02-16 14:44:22.042 [INF] [config] |--> [forward]2022-02-16 14:44:22.042 [INF] [config] muxHTTP2022-02-16 14:44:22.042 [INF] [config] |2022-02-16 14:44:22.042 [INF] [config] |--> [connection]2022-02-16 14:44:22.042 [INF] [config] connect -->|2022-02-16 14:44:22.042 [INF] [config] |2022-02-16 14:44:22.042 [INF] [config] <-----------------------------|2022-02-16 14:44:22.042 [INF] [config]2022-02-16 14:44:22.043 [INF] [listener] Listening on port 8000 at 0.0.0.02022-02-16 14:44:22.070 [INF] [admin] Starting admin service...2022-02-16 14:44:22.071 [INF] [listener] Listening on port 6060 at ::
As displayed in console output, admin console is listening on port 6060. Open http://localhost:6060 in your browser to access it:
- File system: displays the directory where the loaded script resides. You can perform operations on files
- Displays all network interfaces that are currently being listened on
- Log
- Add File
- Set selected file as an main entry script
- Delete file
- Save modifications
- Start from the selected entry script
- Stop
- Reload
- Open/Hide log console
- File list
- Script editor
- Graphical aided Design tool: Shows traffic flow
- Log panel
Script debugging
For script writing, please refer to Configuration API and Tutorials
- Modify response: Return Hi!
- Save modifications
- Reload
Script will listen on port 8080 , refer to Quick start to quickly starting with learning process. Once the script is running, you can invoke below shell command to verify the changes.
$ curl -x POST http://localhost:8080 -d 'hello world'Hi!
At this point, script returns what we expect Hi!. In addition, the modified content is displayed in the file system in real time.