{"action":"opened","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/477","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/477/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/477/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/477","id":58027163,"number":477,"title":"Multithreaded WSGI apps seem to block","user":{"login":"zbuc","id":570040,"avatar_url":"https://avatars.githubusercontent.com/u/570040?v=3","gravatar_id":"","url":"https://api.github.com/users/zbuc","html_url":"https://github.com/zbuc","followers_url":"https://api.github.com/users/zbuc/followers","following_url":"https://api.github.com/users/zbuc/following{/other_user}","gists_url":"https://api.github.com/users/zbuc/gists{/gist_id}","starred_url":"https://api.github.com/users/zbuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbuc/subscriptions","organizations_url":"https://api.github.com/users/zbuc/orgs","repos_url":"https://api.github.com/users/zbuc/repos","events_url":"https://api.github.com/users/zbuc/events{/privacy}","received_events_url":"https://api.github.com/users/zbuc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-18T05:08:10Z","updated_at":"2015-02-18T05:08:10Z","closed_at":null,"body":"In Netlib, it looks like multithreading is enabled on the WSGIAdaptor class that mitmproxy uses: https://github.com/mitmproxy/netlib/blob/master/netlib/wsgi.py#L53\r\n\r\nHowever a simple Flask app that should be able to take advantage of thread switching seems to block on a single thread (*and* block the main mitmproxy threads as well, making the console UI non-responsive): https://gist.github.com/zbuc/9ae9aed56914df70f462\r\n"}}