{"id":21396841,"url":"https://github.com/posixpascal/pwnpr0xy","last_synced_at":"2025-08-30T05:03:39.546Z","repository":{"id":142927078,"uuid":"42613669","full_name":"posixpascal/pwnPr0xy","owner":"posixpascal","description":null,"archived":false,"fork":false,"pushed_at":"2015-09-16T21:16:04.000Z","size":204,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-30T05:02:21.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/posixpascal.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-09-16T21:12:40.000Z","updated_at":"2015-09-16T21:12:48.000Z","dependencies_parsed_at":"2023-03-15T16:45:53.251Z","dependency_job_id":null,"html_url":"https://github.com/posixpascal/pwnPr0xy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/posixpascal/pwnPr0xy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2FpwnPr0xy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2FpwnPr0xy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2FpwnPr0xy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2FpwnPr0xy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posixpascal","download_url":"https://codeload.github.com/posixpascal/pwnPr0xy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2FpwnPr0xy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272805573,"owners_count":24995916,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-22T14:29:34.460Z","updated_at":"2025-08-30T05:03:39.497Z","avatar_url":"https://github.com/posixpascal.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pwnpr0xy and proxyrb\n![Screenshot](https://raw.githubusercontent.com/posixpascal/pwnPr0xy/master/pwnpr0xy.png)\n## pwnpr0xy\nMan. School Proxies suck. No matter how well they are configured, it's always a pain in the ass to deal with proxies.\nEspecially if you're a developer. In my case for example I need to switch between home/school/work environments pretty often.\nSetting a proxy in MacOSX system settings doesn't apply to command line programs like git or programs like firefox.\nAnother annoying thing when dealing with proxies are shell sessions. They usually require an HTTP environment flag to be set... (garn).\n\nThat's why I wrote pwnpr0xy which automagically sets/remove proxies based on a simple but powerful rule system.\nFirst install pwnpr0xy using `gem` or `bundler` (I will release the gem soon). Then write your own custom `proxyrb.yml` like mine below:\n\n```yaml\nproxies: # general key, this is required\n    school: # a proxy name\n        protocols: # not supported yet (always defaults to HTTP, HTTPS)\n        - HTTP\n        - HTTPS\n        - SOCKS\n\n        host: 192.168.10.10 # obvious\n        port: 80\n\n        env: true # set environment HTTP variables\n        systemwide: true # set macosx system proxy\n        git: true # add git http.proxy to config\n        firefox: true # add proxy to firefox\n\n\nnetworks: # general key, required as well.\n    school: # a network name\n        proxy: school # which proxy to use\n        detect_by: # required, how to detect this network\n            ping: # rule (see below)\n            - 192.168.10.10 # argument array\n\n    home: # same\n        proxy: none # no proxy\n        detect_by: \n            iprange:\n            - 192.168.178.0/24\n\n\n    work: \n        proxy: none\n        detect_by:\n            iprange:\n            - 10.0.0.0/24\n\n    default: home\n```\n\n#### The rule system\nEvery network is somehow identifiable using the IP, or the range etc.\nAs soon as all(!!) `detect_by` rules return true, the proxy for the network will be set.\nAtm. I support the following rules:\n\n* ip: checks your current ip with the one in your config\n* iprange: checks whether or not your current ip is in an ip range\n* ping: checks if certain adresses are reachable in your network\n\nYou can write custom rules easily. Just change the rule name (eg. Device) to something else.\n*pwnPr0xy* will look for a class _YourRuleNameRule_  (eg. DeviceRule).\nThese rules have to follow the following format:\n\n```ruby\nclass IprangeRule \u003c Rule\n\tdef initialize(data)\n\t\tsuper(data)\n\t\t# data is an array of ips\n\t\t@ipranges = data\n\tend\n\tdef detect\n\t\t@ipranges.each do |iprange|\n\t\t\t@logger.debug(\"Checking if current IP is in ip range #{iprange}...\")\n\t\t\tnet = IPAddr.new(iprange)\n\t\t\tif net === @ip.v4.ip_address\n\t\t\t\treturn true\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend\nend\n```\n\n*to be continued*\n\n\n## proxyrb\nproxyrb is a gem which sets a proxy for different applications. It's in an early and unusable state, do not use in production pls.\nI will add more documentation later, but you can use it like this:\n```\nrequire 'proxyrb'\nproxy = Proxy.new({\n\t:host =\u003e \"192.168.10.10\",\n\t:port =\u003e 80\n})\n\nproxy.set({\n\t:firefox =\u003e true,\n\t:env =\u003e false\n});\n```\n\nIt only works for *MacOSX* at the moment, I will add linux support (or not because I don't need Linux at school/work).\nYou will have to reload your shell after executing proxyrb. Firefox might not work during development of this gem.\nGit will always change the global config. If you don't like that, remove the **--global** flag in the source code.\n\n# Documentation\npls. stahp.\n\n# License\nGNU GENERAL PUBLIC LICENSE\nVersion 3, 29 June 2007\n\nCopyright (C) 2007 Free Software Foundation, Inc. \u003chttp://fsf.org/\u003e\n\nEveryone is permitted to copy and distribute verbatim copies of this license document, **changing it is not allowed.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposixpascal%2Fpwnpr0xy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposixpascal%2Fpwnpr0xy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposixpascal%2Fpwnpr0xy/lists"}