{"action":"closed","issue":{"url":"https://api.github.com/repos/blinksocks/blinksocks/issues/59","repository_url":"https://api.github.com/repos/blinksocks/blinksocks","labels_url":"https://api.github.com/repos/blinksocks/blinksocks/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/blinksocks/blinksocks/issues/59/comments","events_url":"https://api.github.com/repos/blinksocks/blinksocks/issues/59/events","html_url":"https://github.com/blinksocks/blinksocks/issues/59","id":233210927,"number":59,"title":"HTTP proxy dosen't work on Windows","user":{"login":"micooz","id":8897063,"avatar_url":"https://avatars2.githubusercontent.com/u/8897063?v=3","gravatar_id":"","url":"https://api.github.com/users/micooz","html_url":"https://github.com/micooz","followers_url":"https://api.github.com/users/micooz/followers","following_url":"https://api.github.com/users/micooz/following{/other_user}","gists_url":"https://api.github.com/users/micooz/gists{/gist_id}","starred_url":"https://api.github.com/users/micooz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micooz/subscriptions","organizations_url":"https://api.github.com/users/micooz/orgs","repos_url":"https://api.github.com/users/micooz/repos","events_url":"https://api.github.com/users/micooz/events{/privacy}","received_events_url":"https://api.github.com/users/micooz/received_events","type":"User","site_admin":false},"labels":[{"id":497742978,"url":"https://api.github.com/repos/blinksocks/blinksocks/labels/bug","name":"bug","color":"ee0701","default":true},{"id":622916222,"url":"https://api.github.com/repos/blinksocks/blinksocks/labels/high-priority","name":"high-priority","color":"d93f0b","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-02T15:03:28Z","updated_at":"2017-06-13T14:20:57Z","closed_at":"2017-06-13T14:20:57Z","body":"blinksocks can handle socks5/socks4/socks4a/http requests at the same time, http requests works well on my macOS. But unfortunately, http proxy requests of Windows are different from macOS or **curl**.\r\n\r\nThere is a bug in [HttpRequestMessage.js#L4]:\r\n\r\n```js\r\n// +----------------------------------------+\r\n// |  CONNECT www.bing.com:443 HTTP/1.1\\r\\n |\r\n// |  Host: www.bing.com:443\\r\\n            |\r\n// |  [...Headers]                          |\r\n// |  \\r\\n                                  |\r\n// +----------------------------------------+\r\nif (methods.includes(method)) {\r\n  const host = lines[1].split(' ')[1]; // here is a bug\r\n  return new HttpRequestMessage({\r\n    METHOD: Buffer.from(method),\r\n    URI: Buffer.from(uri),\r\n    VERSION: Buffer.from(version),\r\n    HOST: Buffer.from(host)\r\n  });\r\n}\r\n```\r\n\r\nIt treat the second line of HTTP message as **Host** which likely appear in the different line of headers.\r\n\r\n[HttpRequestMessage.js#L4]: https://github.com/blinksocks/blinksocks/blob/master/src/proxies/http/HttpRequestMessage.js#L47"}}
{"actor":{"display_login":"micooz"}}