{"action":"created","issue":{"url":"https://api.github.com/repos/mirage/ocaml-cohttp/issues/454","labels_url":"https://api.github.com/repos/mirage/ocaml-cohttp/issues/454/labels{/name}","comments_url":"https://api.github.com/repos/mirage/ocaml-cohttp/issues/454/comments","events_url":"https://api.github.com/repos/mirage/ocaml-cohttp/issues/454/events","html_url":"https://github.com/mirage/ocaml-cohttp/issues/454","id":127603477,"number":454,"title":"Yet another reproducible bug, insane for simple request. ","user":{"login":"fxfactorial","id":3036816,"avatar_url":"https://avatars.githubusercontent.com/u/3036816?v=3","gravatar_id":"","url":"https://api.github.com/users/fxfactorial","html_url":"https://github.com/fxfactorial","followers_url":"https://api.github.com/users/fxfactorial/followers","following_url":"https://api.github.com/users/fxfactorial/following{/other_user}","gists_url":"https://api.github.com/users/fxfactorial/gists{/gist_id}","starred_url":"https://api.github.com/users/fxfactorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxfactorial/subscriptions","organizations_url":"https://api.github.com/users/fxfactorial/orgs","repos_url":"https://api.github.com/users/fxfactorial/repos","events_url":"https://api.github.com/users/fxfactorial/events{/privacy}","received_events_url":"https://api.github.com/users/fxfactorial/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-20T04:45:52Z","updated_at":"2016-01-20T06:23:15Z","closed_at":null,"body":"Say you have a server \r\n\r\n```ocaml\r\n\r\n....\r\n    Cohttp_lwt_unix.Server.make ~callback ()\r\n    |> Cohttp_lwt_unix.Server.create ~mode:(`TCP (`Port 5000)) \r\n```\r\nwhere call back just always calls respond_string, \r\nThen you get this insane result.\r\n\r\n<img width=\"650\" alt=\"screen shot 2016-01-19 at 8 45 05 pm\" src=\"https://cloud.githubusercontent.com/assets/3036816/12440170/97ad7ae8-beed-11e5-917f-2a917bac9973.png\">\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mirage/ocaml-cohttp/issues/comments/173107849","html_url":"https://github.com/mirage/ocaml-cohttp/issues/454#issuecomment-173107849","issue_url":"https://api.github.com/repos/mirage/ocaml-cohttp/issues/454","id":173107849,"user":{"login":"fxfactorial","id":3036816,"avatar_url":"https://avatars.githubusercontent.com/u/3036816?v=3","gravatar_id":"","url":"https://api.github.com/users/fxfactorial","html_url":"https://github.com/fxfactorial","followers_url":"https://api.github.com/users/fxfactorial/followers","following_url":"https://api.github.com/users/fxfactorial/following{/other_user}","gists_url":"https://api.github.com/users/fxfactorial/gists{/gist_id}","starred_url":"https://api.github.com/users/fxfactorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxfactorial/subscriptions","organizations_url":"https://api.github.com/users/fxfactorial/orgs","repos_url":"https://api.github.com/users/fxfactorial/repos","events_url":"https://api.github.com/users/fxfactorial/events{/privacy}","received_events_url":"https://api.github.com/users/fxfactorial/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T06:23:15Z","updated_at":"2016-01-20T06:23:15Z","body":"@rgrinberg Sorry you're right. I just feel like I've been filling out bug tickets literally every day lately. \r\n\r\n```ocaml\r\n#require \"cohttp.lwt\"\r\n\r\nlet status_server = Uri.of_string \"http://localhost:5000\"\r\n\r\nlet () =\r\n  let callback _ _ _ =\r\n    let body = \"Hello World\" in\r\n    Cohttp_lwt_unix.Server.respond_string ~status:`OK ~body ()\r\n  in\r\n  let server = Cohttp_lwt_unix.Server.make ~callback () in\r\n  Cohttp_lwt_unix.Server.create ~mode:(`TCP (`Port 5000)) server\r\n  |> Lwt_main.run\r\n```\r\n\r\nThen in utop\r\n\r\n```ocaml\r\nCohttp_lwt_unix.Client.get (Uri.of_string \"http://localhost:5000\");;\r\n```\r\n\r\nYou'll get: \r\n\r\n```ocaml\r\nException: Unix.Unix_error (Unix.ECONNREFUSED, \"connect\", \"\").\r\n```\r\n\r\nThen try with `127.0.0.1` and everything is great.\r\n\r\n```ocaml\r\nCohttp_lwt_unix.Client.get (Uri.of_string \"http://127.0.0.1:5000\");;\r\n- : Cohttp.Response.t * Cohttp_lwt_body.t =                                                                                               ({Cohttp.Response.encoding = Cohttp.Transfer.Fixed 11L; headers = <abstr>; version = `HTTP_1_1; status = `OK; flush = false},              `Stream <abstr>)\r\n```"}}