Title: python-proxy can not be stopped automatically · Issue #2 · salcon/python-proxy · GitHub
Open Graph Title: python-proxy can not be stopped automatically · Issue #2 · salcon/python-proxy
X Title: python-proxy can not be stopped automatically · Issue #2 · salcon/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/salcon/python-proxy/issues/2
X: @github
Domain: patch-diff.githubusercontent.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-06-04T09:01:31.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:b52a15fe-b413-69f0-657b-df17024e2db2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED34:1BD7A5:D0574DD:10E83ADE:6976EC66 |
| html-safe-nonce | 12deff98df829f4d8b6645b3848c3242034d1e83d18b43ee0045fb44a84c56ab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDM0OjFCRDdBNTpEMDU3NEREOjEwRTgzQURFOjY5NzZFQzY2IiwidmlzaXRvcl9pZCI6IjMyOTM1NjMwMTgwNzA2NDk5NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e4232d112f6ffd2ffa740c930600e819797c033789ce56701058cb7e5325452d |
| hovercard-subject-tag | issue:84993547 |
| 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/salcon/python-proxy/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4c252472e50ab11c72870e07e77c39efdd21ec2c805da07267541f1b5e555ba4/salcon/python-proxy/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4c252472e50ab11c72870e07e77c39efdd21ec2c805da07267541f1b5e555ba4/salcon/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/salcon/python-proxy git https://github.com/salcon/python-proxy.git |
| octolytics-dimension-user_id | 5799893 |
| octolytics-dimension-user_login | salcon |
| octolytics-dimension-repository_id | 36859671 |
| octolytics-dimension-repository_nwo | salcon/python-proxy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36859671 |
| octolytics-dimension-repository_network_root_nwo | salcon/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