GithubHelp home page GithubHelp logo

rbino / live_bin Goto Github PK

View Code? Open in Web Editor NEW
35.0 4.0 3.0 260 KB

A self-hostable request bin that doesn't get in your way, powered by Phoenix LiveView

Home Page: https://liveb.in

Elixir 68.81% CSS 18.77% JavaScript 6.88% HTML 1.75% Dockerfile 3.60% Shell 0.11% Batchfile 0.07%
elixir phoenix liveview postbin requestbin

live_bin's Introduction

LiveBin

LiveBin is a simple tool used to inspect HTTP requests.

It tries not to get in your way, it doesn't parse the body or do other fancy stuff with your request. This way you see exactly what was sent. The idea is basically having the same output you would get by doing HTTP requests to a listening instance of netcat.

Under the hood it uses the super cool Phoenix Live View, so new requests are prepended at the top of the page without the need of refreshing.

You can visit liveb.in to try it live.

Running your instance (with Docker)

You can run your instance using the Docker image

export SECRET_KEY_BASE=$(mix phx.gen.secret)
# or `openssl rand -base64 48` if you don't have phx generators installed
docker run -e SECRET_KEY_BASE -p 4000:4000 rbino/live_bin:0.3.0

Now you can visit localhost:4000 from your browser.

Additional environment variables

live_bin accepts these additional environment variables, that you can pass with -e to docker run:

  • PORT: the listening port, that will have to be exposed from the container. Defaults to 4000.
  • PHX_HOST: base host (e.g. example.com) where live_bin is served. Needed to make websockets work and to correctly generate links. Defaults to example.com.
  • LIVE_BIN_INACTIVITY_TIMEOUT: the timeout after which a bin will be deleted if there's no activity on it, in milliseconds. Defaults to infinity.
  • LIVE_BIN_MAX_REQUESTS: the max number of requests that a bin can receive before being deleted. Defaults to nil, which means unlimited.
  • LIVE_BIN_USE_BIN_SUBDOMAINS: if true, generates request URLs appear as <bin_id>.<host> instead of <host>/r/<bin_id>. This just changes the way URLs are generated, to make it work, the reverse proxy must perform the appropriate URL rewriting (taking <bin_id> from the subdomain and putting it in the path).

nginx configuration example

In priv/examples/nginx-example.conf you can find a sample nginx conf to serve as reverse proxy for live_bin, with bin subdomains support. You should just be able to replace live_b.in with your URL and, after obtaining SSL certificates, you should be good to go.

Developing and building

You can run your local instance (to test modifications) simply with:

$ mix deps.get
$ npm install --prefix assets
$ iex -S mix phx.server

Alternatively, you can also rebuild the Docker image with:

$ docker build .

License

Copyright (c) 2019-2022 Riccardo Binetti [email protected]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.