Title: python-proxy can not be stopped automatically · Issue #2 · BackupGGCode/python-proxy · GitHub
Open Graph Title: python-proxy can not be stopped automatically · Issue #2 · BackupGGCode/python-proxy
X Title: python-proxy can not be stopped automatically · Issue #2 · BackupGGCode/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/BackupGGCode/python-proxy/issues/2
X: @github
Domain: github.com
{"@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-04-28T21:32:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/python-proxy/issues/2"}
| 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:1c2a246e-7d14-8797-978e-36fdf937052e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B87A:1D9B97:F3554B5:13BB6C06:697733D0 |
| html-safe-nonce | 3573c386184281054f9f5c984c8fa8976d941789c6f832bbaed91ce35a80aed5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODdBOjFEOUI5NzpGMzU1NEI1OjEzQkI2QzA2OjY5NzczM0QwIiwidmlzaXRvcl9pZCI6IjM4NzYxMTYwOTk4NzkwODkxMDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e028275c5290df4c9c2fc48541036688cc62c47ec1209aadd732761673dc963a |
| hovercard-subject-tag | issue:71709550 |
| 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/BackupGGCode/python-proxy/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/07bf4c90f318b754d6e8b37816b146d564c3f9b2e2e187a3558be89f663fd6fe/BackupGGCode/python-proxy/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07bf4c90f318b754d6e8b37816b146d564c3f9b2e2e187a3558be89f663fd6fe/BackupGGCode/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 | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/BackupGGCode/python-proxy git https://github.com/BackupGGCode/python-proxy.git |
| octolytics-dimension-user_id | 12160263 |
| octolytics-dimension-user_login | BackupGGCode |
| octolytics-dimension-repository_id | 34756972 |
| octolytics-dimension-repository_nwo | BackupGGCode/python-proxy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 34756972 |
| octolytics-dimension-repository_network_root_nwo | BackupGGCode/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 | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width