{"id":36653985,"url":"https://github.com/sapphirecat/devproxy2","last_synced_at":"2026-01-12T10:15:25.254Z","repository":{"id":65771108,"uuid":"253017615","full_name":"sapphirecat/devproxy2","owner":"sapphirecat","description":"Use your production URLs to reach your development environment","archived":false,"fork":false,"pushed_at":"2023-08-01T18:18:56.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T06:28:18.591Z","etag":null,"topics":["http-proxy","interception","redirection","staging"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sapphirecat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-04T14:26:02.000Z","updated_at":"2021-12-19T19:50:45.000Z","dependencies_parsed_at":"2024-06-20T05:45:29.135Z","dependency_job_id":"daa5219a-ccce-42bc-8147-dac93f9779f7","html_url":"https://github.com/sapphirecat/devproxy2","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sapphirecat/devproxy2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapphirecat%2Fdevproxy2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapphirecat%2Fdevproxy2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapphirecat%2Fdevproxy2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapphirecat%2Fdevproxy2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sapphirecat","download_url":"https://codeload.github.com/sapphirecat/devproxy2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapphirecat%2Fdevproxy2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["http-proxy","interception","redirection","staging"],"created_at":"2026-01-12T10:15:25.140Z","updated_at":"2026-01-12T10:15:25.238Z","avatar_url":"https://github.com/sapphirecat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevProxy\n\nUse your production URLs to reach your development environment.\n\n\n# Functionality\n\ndevproxy reads all connection requests, and either sends them to their normal\ndestination, or forwards them to an alternate server. Once the connection is\nmade, data is copied back and forth with no interference.\n\nHTTPS is handled by making the connection, then letting the browser do the TLS\nhandshake. In this case, the alternate server should have a valid certificate\nfor the domain, because the TLS connection is made between server and browser,\nnot devproxy.\n\n\n# Why?\n\nA staging environment should be as close to production as physically possible.\nEvery single difference may be a source of bugs in production that *cannot* be\ndetected in staging.\n\nModifying `/etc/hosts` all the time to point the production DNS at the staging\nserver (or comment said redirection back out) is tedious, invisible, and\nrequires frequent privilege escalations.\n\nWith the proxy switcher, switching the browser between truth and lie is improved\nin all respects: a fast user-level action with a status indicator.  All that you\nneed is a proxy to transparently connect the staging backend when a production\nURL is requested… and that proxy is devproxy.\n\n\n# Examples\n\n## Basic Example\n\nGiven the configuration:\n\n    [[rules]]\n    match_host = '\\bexample.com$'\n    send_to = local\n\n    [servers.local]\n    address = 127.0.0.1\n    http_port = 8080\n    https_port = 8443\n\nWhen the browser requests http://example.com/gnorc from the proxy, then the\nfollowing happens:\n\n1. devproxy connects to 127.0.0.1:8080\n2. devproxy requests `/gnorc`\n3. devproxy copies the request headers, including `Host: example.com`\n4. devproxy copies the full response to the browser\n\n## TLS Example\n\nGiven the same configuration as above, but the browser requests a connection\nto `example.com:443` (because the user asked for https://example.com/rhinoc\nfor example):\n\n1. devproxy connects to 127.0.0.1:8443 and responds with “OK”\n2. The browser and the server do a TLS handshake, which succeeds without\n   warnings if the server has the `example.com` certificate and key available\n3. The browser makes a request with `Host: example.com` inside the tunnel\n4. The server returns a response via the tunnel\n\nSwapping the backend server is the extent of devproxy’s meddling, so it has no\nneed to break the secure connection and read the encrypted data. It simply\ncopies the encrypted data between browser and server.\n\n\n# Using it\n\n1. Clone anywhere with go 1.13 or newer.  You should end up with a\n\t`devproxy2` directory, containing this README.md file.\n2. Edit [devproxy.toml](./devproxy.toml) to configure devproxy for your\n    environment. This is a minimal file; a much longer example with all possible\n    options, and comments for them, is in the\n    [devproxy-full.toml](./devproxy-full.toml) file.\n3. Run `go build`\n4. Run `./devproxy2` (Linux/Mac) or `devproxy2.exe` (Windows).\n5. Set your web proxy to 127.0.0.1:8111, or whatever was configured in your\n    `devproxy.toml` file.\n\nI use [Proxy Switcher and Manager](https://addons.mozilla.org/en-US/firefox/addon/proxy-switcher-and-manager/)\nwith Firefox so that I can easily switch between using devproxy or not, and\nsee at a glance whether I _am_ using it.\n\n\n# Command line flags\n\n## -config\n\nSpecifies a configuration file to use. By default, devproxy looks in the\ndirectory containing the binary, and ../etc relative to the binary. That is, if\ndevproxy were installed as `/usr/local/bin/devproxy`, then the default locations\nare:\n\n1. `/usr/local/bin/devproxy.toml`\n2. `/usr/local/etc/devproxy.toml`\n\nUsing `-config=/home/utena/devproxy.toml` causes that specific file to be\nloaded, avoiding the search entirely.\n\n## -verbose and -debug\n\nWith `-verbose`, devproxy logs requests it receives, and the decisions taken\noverall.  Logs may also be enabled on a per-rule level with `debug_rule = true`;\nthis causes the related rule to log its match decisions in more detail, even\nwithout `-verbose` specified.\n\nWith `-debug`, devproxy tells goproxy to log what _it_ is doing.\n\nThese options are fully independent.  Neither affects nor implies the other.\n\n\n# Container Test\n\nThis repository includes support for building a container to run devproxy2,\nusing the project's oldest supported version of Go (1.13) on the Alpine\ncontainer.\n\nComponents specific to testing the container are as follows:\n\n1. [docker-compose.yml](./docker-compose.yml) – for building a `proxy` image\n2. Dockerfile – specifying the build instructions\n3. docker.toml – the configuration to embed in the container image\n\nUsing `docker-compose up` in the default setting should launch a container that\nforwards requests for `http://example.com/` to the nginx container's \"it works\"\npage.  Or, with Podman, try `sudo docker-compose up`.\n\nThis subsystem is currently tested by the author with Podman, not Docker.\n\n\n# Compatibility\n\ndevproxy2 freezes a new API and configuration file format; changes in devproxy2\nwill be backwards-compatible with version 2.0.0.\n\ndevproxy2 supersedes [devproxy](https://github.com/sapphirecat/devproxy) and\nmakes the following major changes:\n\n- Configuration is done by file, instead of built into the binary\n- Matching occurs on host and port explicitly, instead of trying one regexp\n    against either a \"host\" or \"host:port\" format string\n- Matching a rule results in a specific redirection, not running a function\n- The `-target`, `-listen`, and `-port` command-line options are removed\n- `debug_rule` configuration option added to allow verbosity per-rule\n- Converted to Go Modules\n- Restructured as a single application, not a library\n\n\n# License\n\nSPDX BSD-3-Clause; full text in [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapphirecat%2Fdevproxy2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapphirecat%2Fdevproxy2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapphirecat%2Fdevproxy2/lists"}