{"id":17635947,"url":"https://github.com/mohawk2/mojolicious-command-proxy","last_synced_at":"2026-07-03T01:01:50.962Z","repository":{"id":56840892,"uuid":"269971118","full_name":"mohawk2/Mojolicious-Command-proxy","owner":"mohawk2","description":"Add routes to an app that proxy to another app","archived":false,"fork":false,"pushed_at":"2021-03-08T09:35:22.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T06:14:23.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Mojolicious::Command::proxy","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohawk2.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-06T12:13:09.000Z","updated_at":"2021-03-08T09:35:20.000Z","dependencies_parsed_at":"2022-08-29T12:32:19.730Z","dependency_job_id":null,"html_url":"https://github.com/mohawk2/Mojolicious-Command-proxy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2FMojolicious-Command-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2FMojolicious-Command-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2FMojolicious-Command-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2FMojolicious-Command-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohawk2","download_url":"https://codeload.github.com/mohawk2/Mojolicious-Command-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273515,"owners_count":20750904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T02:24:46.322Z","updated_at":"2025-10-28T02:14:32.964Z","avatar_url":"https://github.com/mohawk2.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nMojolicious::Command::proxy - Proxy web requests elsewhere\n\n# PROJECT STATUS\n\n| OS      |  Build status |\n|:-------:|--------------:|\n| Linux   | [![Build Status](https://travis-ci.org/mohawk2/Mojolicious-Command-proxy.svg?branch=master)](https://travis-ci.org/mohawk2/Mojolicious-Command-proxy) |\n\n[![CPAN version](https://badge.fury.io/pl/Mojolicious-Command-proxy.svg)](https://metacpan.org/pod/Mojolicious::Command::proxy)\n\n# SYNOPSIS\n\n    Usage: APPLICATION proxy [--from route_prefix] to_url\n\n      mojo proxy http://example.com/subdir daemon -l http://*:3000\n      mojo proxy -f /proxy http://example.com/subdir get /proxy/hi\n\n    Options:\n      -f, --from                  Proxying route prefix\n\n# DESCRIPTION\n\n[Mojolicious::Command::proxy](https://metacpan.org/pod/Mojolicious::Command::proxy) is a command line interface for\nmaking an app that proxies some or all incoming requests elsewhere.\nHaving done so, it then passes the rest of its arguments to the app's\n`start` method, as illustrated in the synopsis above.\n\nOne major reason for this is to be able to point your browser at\ne.g. `localhost:3000` (see first example in synopsis). This relaxes\nrestrictions on e.g. Service Workers and push notifications, which\nnormally demand TLS, so you can test functionality even if your real\ndevelopment server is running elsewhere.\n\n# ATTRIBUTES\n\n## description\n\n    $str = $self-\u003edescription;\n\n## usage\n\n    $str = $self-\u003eusage;\n\n# METHODS\n\n## run\n\n    $get-\u003erun(@ARGV);\n\nRun this command. It will add a [\"proxy\"](#proxy) route as below. If not supplied,\nthe `$from` will be empty-string.\n\nCommand-line arguments will only be parsed at the start of the\ncommand-line. This allows you to pass option through to e.g. `daemon`.\n\nAs a special case, if the `app` attribute is exactly a\n[Mojo::HelloWorld](https://metacpan.org/pod/Mojo::HelloWorld) app, it will replace its `routes` attribute with an\nempty one first, since the `whatever` route clashes with the proxy route,\nbeing also a match-everything wildcard route. This makes the `mojo proxy`\ninvocation function as expected.\n\n## proxy\n\n    Mojolicious::Command::proxy-\u003eproxy($app, $from_prefix, $to_prefix);\n\nAdd a route to the given app, with the given prefix, named `proxy`. It\nwill transparently proxy all matching requests to the give `$to`,\nwith all the same headers both ways.\n\nIt operates by simply appending everything after the `$from_prefix`,\nwhich _can_ be an empty string (which is treated the same as solitary\n`/`, doing what you'd expect), to the `$to_prefix`. E.g.:\n\n    $cmd-\u003eproxy($app, '', '/subdir'); # /2 -\u003e /subdir/2, / -\u003e /subdir/ i.e. all\n    $cmd-\u003eproxy($app, '/proxy', '/subdir'); # /proxy/2 -\u003e /subdir/2\n\n`$to` can be a path as well as a full URL, so you can also use this to\nroute internally. However, the author can see no good reason to do this\noutside of testing.\n\nIt uses [\"proxy-\u003estart\\_p\" in Mojolicious::Plugin::DefaultHelpers](https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#proxy-start_p) but\nadds the full header-proxying behaviour.\n\n# AUTHOR\n\nEd J\n\n# COPYRIGHT AND LICENSE\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohawk2%2Fmojolicious-command-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohawk2%2Fmojolicious-command-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohawk2%2Fmojolicious-command-proxy/lists"}