0.2.6 • Published 3 years ago

@andriepu/floo v0.2.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Floo

"Floo is a powerful proxy service used for mocking any requests."

Installation

Install floo globally.

$ npm i -g @andriepu/floo

Add FLOO_ROOT into the last line of your shell environment file (e.g. .bashrc, .zshrc, etc.) based on where you install the package.

export FLOO_ROOT="$(npm root -g)/@andriepu/floo"

Initial Setup

$ floo config

And then, you will be prompted by some questions that you need to adjust with your local environment.

Any config will be saved on your $HOME directory, under the file named config.json inside .floo/ folder. If you want to change any of your config, you can edit it manually or simply re-run this comamnd again.

Usage

  • Starting service:
$ floo start

Once the service started, you can configure your local routings by visiting http://localhost:{{$FRONTEND_PORT}}.

There will be some basic menu that you can access via sidebar:

  • Routings:

    List of routing urls grouped by its subdomain containing data about url to be proxied and how will the request will be handled. URL that can be proxied will be based on http://*.{{$PROXY_HOST}}:{{$PROXY_PORT}}}.

    There will be some informations that you need to provide in order to create a new routing:

    Field NameDescriptionRequired
    HostSubdomain of the target pathYes
    PathPath of target. Leave it blank if you want to cover all the paths. The default matching used here is based on path-to-regexp expression which is used by Express. But if you want to use pure regex, you must put down your regex path between ^ and /No
    Path MethodHTTP method to access the URL. You can select ALL option if you want to cover all methodsYes
    Response TypeMethod used to response to the requested url. Detail about this information will be explained laterYes

    Response Type

    • Dummy:

      This type of response can be used when you have a raw text of response. This can be very useful if the target response is always simple and static.

      Field NameDescriptionRequired
      Mime TypeMIME Type of dummy responseYes
      ResponseRaw text of dummy responseYes
    • Proxy:

      This type of response can be used if you want to forward request to a specific server.

      Field NameDescriptionRequired
      Proxy ServerServer to handle request. Lis of this servers can be configured in Servers menu in sidebarYes
      Auth MaskCredential used on requested serverNo
      Modify PathWhether you want to modify request path or notNo
      Modify ResponseWhether you want to modify response or notNo
      WebsocketWhether you want to proxy websocket or notNo
      Cache ResponseWhether you want to cache the first respnse as a Dummy response and switch the response type to Dummy as wellNo
  • Routing Order:

    Floo will process the request based on the first match of the order. From this menu, you can config the matching order.

  • Servers:

    List of proxy servers.

    There will be some informations that you need to provide in order to create a new server:

    Field NomeDescriptionRequired
    DomainServer domainYes
    AliasServer aliasNo
    AuthenticationAuthentication method that can be used to access server resourceNo