Title: python-proxy can not be stopped automatically · Issue #2 · yuandy/python-proxy · GitHub
Open Graph Title: python-proxy can not be stopped automatically · Issue #2 · yuandy/python-proxy
X Title: python-proxy can not be stopped automatically · Issue #2 · yuandy/python-proxy
Description: What steps will reproduce the problem? 1. Run the script from a python script 2. 3. What is the expected output? What do you see instead? You are in a infinite loop ! If for workaround, you try to launch it into a thread; it's not a good...
Open Graph Description: What steps will reproduce the problem? 1. Run the script from a python script 2. 3. What is the expected output? What do you see instead? You are in a infinite loop ! If for workaround, you try to ...
X Description: What steps will reproduce the problem? 1. Run the script from a python script 2. 3. What is the expected output? What do you see instead? You are in a infinite loop ! If for workaround, you try to ...
Opengraph URL: https://github.com/yuandy/python-proxy/issues/2
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"python-proxy can not be stopped automatically","articleBody":"```\nWhat steps will reproduce the problem?\n1. Run the script from a python script\n2.\n3.\n\nWhat is the expected output? What do you see instead?\nYou are in a infinite loop ! \nIf for workaround, you try to launch it into a thread; it's not a good idea \nbecause in pyhon you can't easily to force the stop it\n\nIn my script, I expecte:\n- to launch the proxy and continue the script.\n- to stop it\n\nWhat version of the product are you using? On what operating system?\nversion: '0.1.0 Draft 1'\nOS: Windows 7\n\nPlease provide any additional information below.\n\nI propose you encapsulate the start/stop in a class:\n\nSee below (file in attachment), this example don't take into account the IPV6 \nand timeout\n\nclass ConnectionHandler(SocketServer.BaseRequestHandler):\n\n #Instead of __init__\n def handle(self):\n self.client = self.request\n ....\n\nclass WebProxy:\n def __init__(self):\n self.server = None\n\n\n def start(self, host='localhost', port=8080, IPv6=False, timeout=60,\n handler=ConnectionHandler):\n\n print \"Start proxy server\"\n #For the moment only in IPV4\n # if IPv6==True:\n # For IPV6, override SocketServer.ThreadingTCPServer\n # soc_type=socket.AF_INET6\n # else:\n # soc_type=socket.AF_INET\n\n self.server = SocketServer.ThreadingTCPServer((host, port), handler)\n\n # Start a thread with the server -- that thread will then start one\n # more thread for each request\n server_thread = threading.Thread(target=self.server.serve_forever)\n # Exit the server thread when the main thread terminates\n server_thread.daemon = True\n server_thread.start()\n\n def stop(self):\n if self.server is not None:\n print \"Stop proxy server\"\n self.server.shutdown()\n\n```\n\nOriginal issue reported on code.google.com by `cyrilbes...@aol.com` on 28 Mar 2013 at 10:15\n\nAttachments:\n- [PythonProxy.py](https://storage.googleapis.com/google-code-attachments/python-proxy/issue-2/comment-0/PythonProxy.py)\n","author":{"url":"https://github.com/GoogleCodeExporter","@type":"Person","name":"GoogleCodeExporter"},"datePublished":"2015-03-23T06:15:36Z","url":"https://github.com/yuandy/python-proxy/issues/2"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6f6ad072-9581-e16b-d687-a969ca56d2a7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D912:26BB87:2734034:338077C:6B036FFB |
| html-safe-nonce | 2308d497020f438775cdb02a5ec3065989fac540cf8898022bd59df6f7828b9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTEyOjI2QkI4NzoyNzM0MDM0OjMzODA3N0M6NkIwMzZGRkIiLCJ2aXNpdG9yX2lkIjoiMzE3Mjg2MzczNDAyMDUzNDI2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4e7d49493b4fa3f308dd465b3a13c257a73ca8877b31529b71ba8f6c16cec604 |
| hovercard-subject-tag | issue:63636149 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/yuandy/python-proxy/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c539931f6959bf48733ff5b73bbb822002a7cf599d654492688155a4528812e/yuandy/python-proxy/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c539931f6959bf48733ff5b73bbb822002a7cf599d654492688155a4528812e/yuandy/python-proxy/issues/2 |
| og:image:alt | What steps will reproduce the problem? 1. Run the script from a python script 2. 3. What is the expected output? What do you see instead? You are in a infinite loop ! If for workaround, you try to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | GoogleCodeExporter |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/yuandy/python-proxy git https://github.com/yuandy/python-proxy.git |
| octolytics-dimension-user_id | 9608949 |
| octolytics-dimension-user_login | yuandy |
| octolytics-dimension-repository_id | 32714329 |
| octolytics-dimension-repository_nwo | yuandy/python-proxy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 32714329 |
| octolytics-dimension-repository_network_root_nwo | yuandy/python-proxy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width