Metadata-Version: 1.1
Name: proxybootstrap
Version: 0.1.1
Summary: A simple python wrapper script for bootstrapping a reverse proxy inside a docker container.
Home-page: https://github.com/romnnn/proxybootstrap
Author: romnn
Author-email: contact@romnn.com
License: MIT
Description: 
        CORS reverse development proxy
        ------------------------------
        
        
        .. image:: https://travis-ci.com/romnnn/proxybootstrap.svg?branch=master
           :target: https://travis-ci.com/romnnn/proxybootstrap.svg?branch=master
           :alt: Build Status
        
        
        .. image:: https://img.shields.io/pypi/l/proxybootstrap
           :target: https://img.shields.io/pypi/l/proxybootstrap
           :alt: PyPI License
        
        
        .. image:: https://img.shields.io/pypi/v/proxybootstrap
           :target: https://img.shields.io/pypi/v/proxybootstrap
           :alt: PyPI Version
        
        
        .. image:: https://img.shields.io/pypi/pyversions/proxybootstrap
           :target: https://img.shields.io/pypi/pyversions/proxybootstrap
           :alt: PyPI Python versions
        
        
        A simple yet extensible python wrapper script for templating a proxy ``nginx`` configuration
        that functions as host mapped reverse proxy container. 
        
        Why and when to use?
        ~~~~~~~~~~~~~~~~~~~~
        
        Modern browsers enforce CORS policy and `won't let you <https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS>`_ make requests
        from your frontend running on ``localhost:8080`` to your backend at 
        ``localhost:4000``. To solve this problem, start a proxy at ``localhost:5000``
        (or any other spare port) and proxy requests based on paths:
        
        
        * ``localhost:5000/api`` and ``localhost:5000/buy`` will be routed to the backend ``localhost:4000``
        * ``localhost:5000/`` will be routed to the frontend ``localhost:8080``
        
        Installation and usage
        ~~~~~~~~~~~~~~~~~~~~~~
        
        **Note**\ : You need to have ``docker`` installed
        
        After you cloned the repository, install dependencies with
        
        .. code-block:: bash
        
           pip install proxybootstrap # using pip
           pipx install proxybootstrap # using pipx
        
        Start the proxy server with your configuration
        
        .. code-block:: bash
        
           python start.py \
               --port 5000 \
               /api@http://127.0.0.1:4000 /buy@http://127.0.0.1:4000 /@http://127.0.0.1:8080
        
        Customization
        ~~~~~~~~~~~~~
        
        .. list-table::
           :header-rows: 1
        
           * - Option
             - Description
             - Default 
           * - ``locations``
             - service locations to proxy.
             - None
           * - ``-c`` / ``-config``
             - ``nginx`` config template file
             - ``./config/default.conf``
           * - ``--port``
             - listening port for the reverse proxy
             - 5000
           * - ``--verbose``
             - enable verbose output
             - ``False``
           * - ``--sync``
             - force synchronous communication with the proxy
             - ``False``
           * - ``--tag``
             - docker tag for the reverse proxy container
             - dev/cors-reverse-proxy
           * - ``--dockerfile``
             - dockerfile for building the container
             - ``./Dockerfile``
        
        
        Under the hood, configuration options are applied to the ``--config`` template
        file and rendered using ``jinja2``. If you wish, you can pass additional arguments and use
        them in the config template.
        Example:
        
        .. code-block:: bash
        
           python start.py \
               -my_var1 Test1 \
               --my_var2 Test2 \
               --port 5000 \
               /@http://127.0.0.1:8080
        
        can be accessed in a template with
        
        .. code-block::
        
           {{ my_var1 }}
           {{ my_var2 }}
        
        Alternatives
        ~~~~~~~~~~~~
        
        
        * Write a custom proxy configuration for ``nginx`` or other proxy servers like
          ``trafik``\ , ``envoy`` or ``haproxy``
        * When using webpack or another popular tool there might be some plugins like 
          `devserver-proxy <https://cli.vuejs.org/config/#devserver-proxy>`_ for `vuejs <https://vuejs.org>`_
        * Mess around with headers to allow specific CORS requests
        
        Development
        ~~~~~~~~~~~
        
        If you do not have ``pipx`` and ``pipenv``\ , install with
        
        .. code-block:: bash
        
           python3 -m pip install --user pipx
           python3 -m pipx ensurepath
           pipx install pipenv
        
        Install all dependencies with
        
        .. code-block:: bash
        
           pipenv install --dev
        
        To format, sort imports and check PEP8 conformity, run
        
        .. code-block:: bash
        
           pipenv run black .
           pipenv run isort
           pipenv run flake8
        
        (These are also configured as a git pre commit hook)
        
        Notice
        ~~~~~~
        
        This configuration is very minimal and intended for development use only.
        
Keywords: reverse,proxy,container,docker,wrapper,CORS,nginx
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
