• 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()
        • acceptSOCKS()
        • acceptTLS()
        • branch()
        • compressHTTP()
        • compressMessage()
        • connect()
        • connectHTTPTunnel()
        • connectSOCKS()
        • connectTLS()
        • decodeDubbo()
        • decodeHTTPRequest()
        • decodeHTTPResponse()
        • decodeMQTT()
        • decodeMultipart()
        • decodeWebSocket()
        • decompressHTTP()
        • decompressMessage()
        • deframe()
        • demux()
        • demuxHTTP()
        • demuxQueue()
        • depositMessage()
        • detectProtocol()
        • dummy()
        • dump()
        • encodeDubbo()
        • encodeHTTPRequest()
        • encodeHTTPResponse()
        • encodeMQTT()
        • encodeWebSocket()
        • exec()
        • export()
        • fork()
        • handleData()
        • handleMessage()
        • handleMessageBody()
        • handleMessageEnd()
        • handleMessageStart()
        • handleStreamEnd()
        • handleStreamStart()
        • handleTLSClientHello()
        • import()
        • input()
        • link()
        • listen()
        • merge()
        • mux()
        • muxHTTP()
        • muxQueue()
        • onEnd()
        • onStart()
        • output()
        • pack()
        • pipeline()
        • print()
        • read()
        • replaceData()
        • replaceMessage()
        • replaceMessageBody()
        • replaceMessageEnd()
        • replaceMessageStart()
        • replaceStreamEnd()
        • replaceStreamStart()
        • serveHTTP()
        • split()
        • task()
        • tee()
        • throttleConcurrency()
        • throttleDataRate()
        • throttleMessageRate()
        • to()
        • use()
        • wait()
      • Data
        • Data()
        • push()
        • shift()
        • shiftTo()
        • shiftWhile()
        • size
      • Hessian
        • decode()
        • encode()
      • JSON
        • decode()
        • encode()
        • parse()
        • parse()
      • Message
        • body
        • head
        • tail
      • MessageEnd
        • tail
      • MessageStart
        • head
      • Netmask
        • base
        • bitmask
        • broadcast
        • contains()
        • first
        • hostmask
        • last
        • mask
        • next()
        • size
      • StreamEnd
        • error
      • URL
        • auth
        • hash
        • host
        • hostname
        • href
        • origin
        • password
        • path
        • pathname
        • port
        • protocol
        • query
        • search
        • searchParams
        • username
      • URLSearchParams
        • get()
        • getAll()
        • set()
        • toObject()
      • XML
        • Node
          • attributes
          • children
          • name
        • decode()
        • encode()
        • parse()
        • stringify()
      • algo
        • Cache
          • clear()
          • get()
          • remove()
          • set()
        • HashingLoadBalancer
          • add()
          • deselect()
          • next()
          • select()
        • LeastWorkLoadBalancer
          • deselect()
          • next()
          • select()
          • set()
        • Percentile
          • calculate()
          • observe()
          • reset()
        • ResourcePool
          • allocate()
          • free()
        • RoundRobinLoadBalancer
          • deselect()
          • next()
          • select()
          • set()
        • URLRouter
          • add()
          • find()
      • console
        • log()
      • crypto
        • Certificate
        • CertificateChain
        • Cipher
        • Decipher
        • Hash
        • Hmac
        • JWK
        • JWT
        • PrivateKey
        • PublicKey
        • Sign
        • Verify
      • http
        • File
          • from()
          • toMessage()
      • os
        • Stats
          • atime
          • blksize
          • blocks
          • ctime
          • dev
          • gid
          • ino
          • isBlockDevice()
          • isCharacterDevice()
          • isDirectory()
          • isFIFO()
          • isFile()
          • isSocket()
          • isSymbolicLink()
          • mode
          • mtime
          • nlink
          • rdev
          • size
          • uid
        • env
        • readFile()
        • stat()
        • writeFile()
      • pipy()
        • exit()
        • load()
      • repeat()
      • stats
        • Counter
          • decrease()
          • increase()
          • withLabels()
          • zero()
        • Gauge
          • decrease()
          • increase()
          • set()
          • withLabels()
          • zero()
        • Histogram
          • observe()
          • withLabels()
          • zero()
    • PipyJS
      • Language
      • Builtin Objects

    Quick Start

    For learning, development, or debugging purposes it's recommended to proceed with the local installation (either build from sources or download pre-built release for your specific OS) of Pipy as it comes with admin web console along with documentation and tutorials.

    Once installed locally, running pipy without any arguments starts the admin console on port 6060 and it can be configured to listen on the different port via --admin-port= argument.

    To easily install Pipy on macOS, WSL you can use Homebrew.

    $ brew update
    $ brew tap flomesh-io/pipy
    $ brew install pipy

    Upgrade

    When a new Pipy version is released you can upgrade your system using:

    $ brew update
    $ brew upgrade pipy

    Run via CLI

    To start a Pipy proxy, run pipy with a PipyJS script file, for example, the script in tutorial/01-hello/hello.js if you need a simple echo server that responds with the same message body as in every incoming request:

    $ pipy tutorial/01-hello/hello.js

    Alternatively, while developing and debugging, one can start Pipy with a builtin web UI:

    $ pipy tutorial/01-hello/hello.js --admin-port=6060

    Run via Docker

    Annother approach is running with Docker. Note: this image has no builtin admin console.

    docker run --rm -v $PWD/tutorial:/tutorial -p 8080:8080 flomesh/pipy-pjs:latest pipy /tutorial/01-hello/hello.js

    Show Command-Line Options

    $ pipy --help

    List Builtin Filters and Their Parameters

    Open the browser of your choice, point to http://localhost:6060. You will now see the Admin UI where you can start exploring the documentation and playing around with the tutorial codebases.

    You'll find built-in filters and help information in http://localhost:6060/docs/reference/api/Configuration.


    © 2022, Flomesh Team.