{"id":26644983,"url":"https://github.com/aymanmomin/meme-generating-proxy-server","last_synced_at":"2025-09-07T20:03:54.500Z","repository":{"id":284182961,"uuid":"954102100","full_name":"aymanmomin/Meme-Generating-Proxy-Server","owner":"aymanmomin","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-24T15:09:22.000Z","size":4933,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T20:03:49.224Z","etag":null,"topics":["meme-generator","proxy-server","python3","socket-programming"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aymanmomin.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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":"2025-03-24T15:07:32.000Z","updated_at":"2025-03-24T15:10:29.000Z","dependencies_parsed_at":"2025-03-24T16:35:04.860Z","dependency_job_id":null,"html_url":"https://github.com/aymanmomin/Meme-Generating-Proxy-Server","commit_stats":null,"previous_names":["aymanmomin/meme-generating-proxy-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aymanmomin/Meme-Generating-Proxy-Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanmomin%2FMeme-Generating-Proxy-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanmomin%2FMeme-Generating-Proxy-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanmomin%2FMeme-Generating-Proxy-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanmomin%2FMeme-Generating-Proxy-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aymanmomin","download_url":"https://codeload.github.com/aymanmomin/Meme-Generating-Proxy-Server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aymanmomin%2FMeme-Generating-Proxy-Server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274088627,"owners_count":25220260,"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-09-07T02:00:09.463Z","response_time":67,"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":["meme-generator","proxy-server","python3","socket-programming"],"created_at":"2025-03-24T21:21:15.702Z","updated_at":"2025-09-07T20:03:54.451Z","avatar_url":"https://github.com/aymanmomin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Meme-Generating Proxy Server\r\n## About\r\nThis application is a proxy server that intercepts HTTP traffic and injects humor into web browsing:\r\n1. **Image Replacement**: Replaces 50% of images on webpages with memes from a predefined folder.\r\n2. **Easter Egg**: Returns a custom meme page when accessing `http://google.ca`.\r\n3. **HTTP Handling**: Manages multiple client connections and gracefully ignores HTTPS requests.\r\n\r\n\r\n## Features  \r\n- **Proxy Server**:  \r\n  - TCP socket-based proxy with multithreaded client handling  \r\n  - Image interception and replacement logic (JPEG/PNG/GIF)  \r\n  - Custom Easter egg response for specific URLs  \r\n  - Error handling for invalid requests and unsupported protocols  \r\n- **Test Client**:  \r\n  - Basic HTTP request testing  \r\n  - Validation of Easter egg functionality  \r\n\r\n## Installation  \r\n1. **Prerequisites**:  \r\n   - Python 3.6+  \r\n   - Required packages:  \r\n     ```bash\r\n     pip install Pillow\r\n     ```\r\n\r\n2. **Setup**:  \r\n   - Create a `memes` folder with 15+ images named `meme1.jpg`, `meme2.jpg`, etc.  \r\n   - Files:  \r\n     - `Proxy_Server.py`: Core proxy server  \r\n     - `Proxy_Client.py`: Test client  \r\n     - `memes/`: Folder containing meme images  \r\n\r\n## Usage  \r\n1. **Start the Proxy Server**:  \r\n   ```bash\r\n   python Proxy_Server.py\r\n    ```\r\n   - The server runs on `127.0.0.1:8080`.\r\n  \r\n2. **Configure Browser (Firefox)**:\r\n    ``` bash\r\n    python client.py\r\n    ```\r\n    - Go to about:preferences#general \u003e Network Settings\r\n    - Manual proxy: `127.0.0.1`, Port `8080`\r\n    - **Uncheck** \"Use this proxy for all protocols\"\r\n3. **Test Functionality**\r\n    - **Image Replacement**:\r\n      - Visit `http://httpbin.org/image/jpeg` \r\n      - 50% chance of meme replacement\r\n    - **Easter Egg**\r\n      - Visit `http://google.ca` (not HTTPS) for surprise meme page\r\n\r\n\r\n## Outputs\r\n- Original: http://httpbin.org/image/jpeg → Displays default/test image\r\n- Through Proxy: 50% chance of showing meme instead\r\n- http://google.ca → Shows centered meme with \"MEME SURPRISE!\" header\r\n\r\n## Technical Details\r\n- Image Handling:\r\n  - Uses `mimetypes` for content-type detection\r\n  - Base64 encoding for inline image embedding\r\n- Protocols:\r\n  - Explicitly blocks HTTPS CONNECT requests\r\n  - Only processes HTTP traffic\r\n\r\n## Disclaimer\r\nThe proxy only works for HTTP websites. HTTPS sites will either be blocked or bypass the proxy depending on browser configuration.\r\n\r\n## Extra Credit (Optional)\r\nBasic Encryption: Implemented basic encryption for data transmitted between the server and client using caesar cipher.\r\n\r\n## Referred Links\r\n- HTTP Proxy Fundamentals: https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling\r\n- Python Socket Programming: https://docs.python.org/3/library/socket.html \r\n- Base64 Encoding: https://en.wikipedia.org/wiki/Base64","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faymanmomin%2Fmeme-generating-proxy-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faymanmomin%2Fmeme-generating-proxy-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faymanmomin%2Fmeme-generating-proxy-server/lists"}