{"action":"closed","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1098","repository_url":"https://api.github.com/repos/mitmproxy/mitmproxy","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1098/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1098/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1098/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/1098","id":151102492,"number":1098,"title":"return HTTPResponse in upstream mode","user":{"login":"qifuren1985","id":187371,"avatar_url":"https://avatars.githubusercontent.com/u/187371?v=3","gravatar_id":"","url":"https://api.github.com/users/qifuren1985","html_url":"https://github.com/qifuren1985","followers_url":"https://api.github.com/users/qifuren1985/followers","following_url":"https://api.github.com/users/qifuren1985/following{/other_user}","gists_url":"https://api.github.com/users/qifuren1985/gists{/gist_id}","starred_url":"https://api.github.com/users/qifuren1985/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qifuren1985/subscriptions","organizations_url":"https://api.github.com/users/qifuren1985/orgs","repos_url":"https://api.github.com/users/qifuren1985/repos","events_url":"https://api.github.com/users/qifuren1985/events{/privacy}","received_events_url":"https://api.github.com/users/qifuren1985/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-26T10:51:53Z","updated_at":"2016-04-30T21:03:02Z","closed_at":"2016-04-30T21:03:02Z","body":"##### Steps to reproduce the problem:\r\n\r\n1. init upstream mode\r\n```\r\nconfig = proxy.ProxyConfig(\r\n        cadir=os.path.expanduser('./'),\r\n        port=9077,\r\n        mode='upstream',\r\n        upstream_server=(\"http\", (\"127.0.0.1\", 9977))\r\n    )\r\n    server = proxy.ProxyServer(config)\r\n```\r\n2. return HTTPResponse in request\r\n```\r\ndef request(context, flow):\r\n     resp = HTTPResponse(\r\n                \"HTTP/1.1\", 200, \"OK\",\r\n                Headers(Content_Type=\"text/html\"),\r\n                \"helloworld\")\r\n            msg.reply(resp)\r\n```\r\n3. use curl to get response\r\n```\r\ncurl \"http://www.google.com\" -x \"http://127.0.0.1:9077\" -k\r\nhelloworld\r\n \r\ncurl \"https://www.google.com\" -x \"http://127.0.0.1:9077\" -k\r\ncurl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol\r\n```\r\n##### What is the expected behavior?\r\nreturn helloworld\r\n\r\n##### What went wrong?\r\n```\r\ncurl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol\r\n```\r\n\r\n##### Any other comments?\r\n\r\n\r\n---\r\n\r\nMitmproxy Version:\r\nOperating System: "}}