Products

English

English

  • Pipy Documentation
  • Introduction
    • Overview
    • Concepts
  • Getting Started
    • Build and Install
    • Quick Start
    • Getting help
  • Release
    • Release History
      • 0.10.0-1
      • 0.22.0-31
      • 0.30.0
      • 0.50.0
  • Tutorial
    • Part 1: Hello
    • Part 2: Echo
    • Part 3: Proxy
    • Part 4: Routing
    • Part 5: Loading Balancing
    • Part 6: Configuration
    • Part 7: Plugins
  • Operating
    • Admin GUI
    • CLI
    • Pipy Repo
      • Introduction
      • Quick Start
      • Demo
      • REST API
    • Statistics
  • Reference
    • API
      • Configuration
        • acceptHTTPTunnel()
        • acceptProxyProtocol()
        • acceptSOCKS()
        • acceptTLS()
        • admin()
        • branch()
        • branchMessage()
        • branchMessageStart()
        • chain()
        • compress()
        • compressHTTP()
        • connect()
        • connectHTTPTunnel()
        • connectProxyProtocol()
        • connectSOCKS()
        • connectTLS()
        • decodeBGP()
        • decodeDubbo()
        • decodeHTTPRequest()
        • decodeHTTPResponse()
        • decodeMQTT()
        • decodeMultipart()
        • decodeRESP()
        • decodeThrift()
        • decodeWebSocket()
        • decompress()
        • decompressHTTP()
        • deframe()
        • demux()
        • demuxHTTP()
        • detectProtocol()
        • dummy()
        • dump()
        • encodeBGP()
        • encodeDubbo()
        • encodeHTTPRequest()
        • encodeHTTPResponse()
        • encodeMQTT()
        • encodeRESP()
        • encodeThrift()
        • encodeWebSocket()
        • exec()
        • exit()
        • export()
        • fork()
        • handleData()
        • handleMessage()
        • handleMessageBody()
        • handleMessageEnd()
        • handleMessageStart()
        • handleStreamEnd()
        • handleStreamStart()
        • handleTLSClientHello()
        • import()
        • insert()
        • link()
        • listen()
        • loop()
        • mux()
        • muxHTTP()
        • onEnd()
        • onStart()
        • pack()
        • pipeline()
        • print()
        • read()
        • repeat()
        • replaceData()
        • replaceMessage()
        • replaceMessageBody()
        • replaceMessageEnd()
        • replaceMessageStart()
        • replaceStreamEnd()
        • replaceStreamStart()
        • replay()
        • serveHTTP()
        • split()
        • task()
        • tee()
        • throttleConcurrency()
        • throttleDataRate()
        • throttleMessageRate()
        • to()
        • use()
        • wait()
        • watch()
      • Data
        • from()
        • Data()
        • push()
        • shift()
        • shiftTo()
        • shiftWhile()
        • size
        • toArray()
      • Hessian
        • decode()
        • encode()
      • JSON
        • decode()
        • encode()
        • parse()
        • stringify()
      • Message
        • body
        • head
        • Message()
        • tail
      • MessageEnd
        • MessageEnd()
        • payload
        • tail
      • MessageStart
        • head
        • MessageStart()
      • Netmask
        • base
        • bitmask
        • broadcast
        • contains()
        • decompose()
        • first
        • hostmask
        • ip
        • last
        • mask
        • Netmask()
        • next()
        • size
        • version
      • StreamEnd
        • error
        • StreamEnd()
      • URL
        • auth
        • hash
        • host
        • hostname
        • href
        • URL()
        • origin
        • password
        • path
        • pathname
        • port
        • protocol
        • query
        • search
        • searchParams
        • username
      • URLSearchParams
        • get()
        • getAll()
        • URLSearchParams()
        • set()
        • toObject()
      • XML
        • Node
          • attributes
          • children
          • name
          • Node()
        • decode()
        • encode()
        • parse()
        • stringify()
      • algo
        • Cache
          • clear()
          • get()
          • Cache()
          • remove()
          • set()
        • HashingLoadBalancer
          • add()
          • HashingLoadBalancer()
          • next()
        • LeastWorkLoadBalancer
          • LeastWorkLoadBalancer()
          • next()
          • set()
        • LoadBalancer
          • allocate()
          • LoadBalancer()
          • provision()
          • schedule()
        • LoadBalancerResource
          • free()
          • target
        • Quota
          • consume()
          • current
          • initial
          • Quota()
          • produce()
          • reset()
        • RoundRobinLoadBalancer
          • RoundRobinLoadBalancer()
          • next()
          • set()
        • URLRouter
          • add()
          • find()
          • URLRouter()
        • hash()
        • uuid()
      • console
        • debug()
        • error()
        • info()
        • log()
        • warn()
      • crypto
        • Certificate
          • issuer
          • Certificate()
          • subject
          • subjectAltNames
        • CertificateChain
          • CertificateChain()
        • Cipher
          • final()
          • Cipher()
          • update()
        • Decipher
          • final()
          • Decipher()
          • update()
        • Hash
          • digest()
          • Hash()
          • update()
        • Hmac
          • digest()
          • Hmac()
          • update()
        • JWK
          • isValid
          • JWK()
        • JWT
          • header
          • isValid
          • JWT()
          • payload
          • verify()
        • PrivateKey
          • PrivateKey()
        • PublicKey
          • PublicKey()
        • Sign
          • Sign()
          • sign()
          • update()
        • Verify
          • Verify()
          • update()
          • verify()
      • http
        • Agent
          • new()
          • request()
        • Directory
          • new()
          • serve()
      • logging
        • BinaryLogger
          • log()
          • BinaryLogger()
          • toFile()
          • toHTTP()
          • toStderr()
          • toStdout()
          • toSyslog()
        • JSONLogger
          • log()
          • JSONLogger()
          • toFile()
          • toHTTP()
          • toStderr()
          • toStdout()
          • toSyslog()
        • TextLogger
          • log()
          • TextLogger()
          • toFile()
          • toHTTP()
          • toStderr()
          • toStdout()
          • toSyslog()
      • os
        • env
        • readDir()
        • readFile()
        • stat()
        • unlink()
        • writeFile()
      • pipy()
        • exit()
        • load()
        • restart()
        • solve()
      • stats
        • Counter
          • decrease()
          • increase()
          • Counter()
          • withLabels()
          • zero()
        • Gauge
          • decrease()
          • increase()
          • Gauge()
          • set()
          • withLabels()
          • zero()
        • Histogram
          • Histogram()
          • observe()
          • withLabels()
          • zero()
    • PipyJS
      • Language
      • Builtin Objects
      • NMI

    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.js
    2022-02-16 14:44:22.042 [INF] [config]
    2022-02-16 14:44:22.042 [INF] [config] Module /proxy.js
    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] [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] demuxHTTP
    2022-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] muxHTTP
    2022-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.0
    2022-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:

    1. File system: displays the directory where the loaded script resides. You can perform operations on files
    2. Displays all network interfaces that are currently being listened on
    3. Log
    4. Add File
    5. Set selected file as an main entry script
    6. Delete file
    7. Save modifications
    8. Start from the selected entry script
    9. Stop
    10. Reload
    11. Open/Hide log console
    12. File list
    13. Script editor
    14. Graphical aided Design tool: Shows traffic flow
    15. Log panel

    Script debugging

    For script writing, please refer to Configuration API and Tutorials

    1. Modify response: Return Hi!
    2. Save modifications
    3. 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.


    © 2024, Flomesh Team.       ICP备案/许可证号:辽ICP备2023014827号