{"action":"created","comment":{"url":"https://api.github.com/repos/jefimenko/network_tools/pulls/comments/24785547","id":24785547,"diff_hunk":"@@ -0,0 +1,89 @@\n+import socket\n+\n+\n+def create_server_socket():\n+    server_socket = socket.socket(\n+        socket.AF_INET,\n+        socket.SOCK_STREAM,\n+        socket.IPPROTO_IP)\n+    # Set up the server socket\n+    server_socket.bind(('127.0.0.1', 50000))\n+    server_socket.listen(1)\n+    return server_socket\n+\n+\n+def response_ok():\n+    return \"\"\"\\\n+HTTP/1.1 200 OK\\r\\n\\\n+Content-Type: text/plain\\r\\n\\r\\n\\\n+Hey you.\\r\\n\\\n+\"\"\"","path":"echo_server.py","position":20,"original_position":20,"commit_id":"147e0ada0f483f2d3537de5d42f56b728ed16506","original_commit_id":"147e0ada0f483f2d3537de5d42f56b728ed16506","user":{"login":"cewing","id":417109,"avatar_url":"https://avatars.githubusercontent.com/u/417109?v=3","gravatar_id":"","url":"https://api.github.com/users/cewing","html_url":"https://github.com/cewing","followers_url":"https://api.github.com/users/cewing/followers","following_url":"https://api.github.com/users/cewing/following{/other_user}","gists_url":"https://api.github.com/users/cewing/gists{/gist_id}","starred_url":"https://api.github.com/users/cewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cewing/subscriptions","organizations_url":"https://api.github.com/users/cewing/orgs","repos_url":"https://api.github.com/users/cewing/repos","events_url":"https://api.github.com/users/cewing/events{/privacy}","received_events_url":"https://api.github.com/users/cewing/received_events","type":"User","site_admin":false},"body":"This will not be a properly formatted HTTP response.  Using the python multi-line string ensures that `\\n` is already at the end of each line.  So you *could* just use the `\\r`, but even that is prone to errors.  Instead, assemble each line separately and append them into a list, then join the list with `\"\\r\\n\"`.","created_at":"2015-02-17T00:47:46Z","updated_at":"2015-02-17T00:47:46Z","html_url":"https://github.com/jefimenko/network_tools/pull/2#discussion_r24785547","pull_request_url":"https://api.github.com/repos/jefimenko/network_tools/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/jefimenko/network_tools/pulls/comments/24785547"},"html":{"href":"https://github.com/jefimenko/network_tools/pull/2#discussion_r24785547"},"pull_request":{"href":"https://api.github.com/repos/jefimenko/network_tools/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/jefimenko/network_tools/pulls/2","id":29154326,"html_url":"https://github.com/jefimenko/network_tools/pull/2","diff_url":"https://github.com/jefimenko/network_tools/pull/2.diff","patch_url":"https://github.com/jefimenko/network_tools/pull/2.patch","issue_url":"https://api.github.com/repos/jefimenko/network_tools/issues/2","number":2,"state":"closed","locked":false,"title":"http server step 1","user":{"login":"jefimenko","id":3172658,"avatar_url":"https://avatars.githubusercontent.com/u/3172658?v=3","gravatar_id":"","url":"https://api.github.com/users/jefimenko","html_url":"https://github.com/jefimenko","followers_url":"https://api.github.com/users/jefimenko/followers","following_url":"https://api.github.com/users/jefimenko/following{/other_user}","gists_url":"https://api.github.com/users/jefimenko/gists{/gist_id}","starred_url":"https://api.github.com/users/jefimenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefimenko/subscriptions","organizations_url":"https://api.github.com/users/jefimenko/orgs","repos_url":"https://api.github.com/users/jefimenko/repos","events_url":"https://api.github.com/users/jefimenko/events{/privacy}","received_events_url":"https://api.github.com/users/jefimenko/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-12T05:41:43Z","updated_at":"2015-02-17T00:47:46Z","closed_at":"2015-02-12T05:48:30Z","merged_at":"2015-02-12T05:48:30Z","merge_commit_sha":"13e46e240834f33e4ecbe818ed5a0f8913433f64","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jefimenko/network_tools/pulls/2/commits","review_comments_url":"https://api.github.com/repos/jefimenko/network_tools/pulls/2/comments","review_comment_url":"https://api.github.com/repos/jefimenko/network_tools/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jefimenko/network_tools/issues/2/comments","statuses_url":"https://api.github.com/repos/jefimenko/network_tools/statuses/147e0ada0f483f2d3537de5d42f56b728ed16506","head":{"label":"jefimenko:http","ref":"http","sha":"147e0ada0f483f2d3537de5d42f56b728ed16506","user":{"login":"jefimenko","id":3172658,"avatar_url":"https://avatars.githubusercontent.com/u/3172658?v=3","gravatar_id":"","url":"https://api.github.com/users/jefimenko","html_url":"https://github.com/jefimenko","followers_url":"https://api.github.com/users/jefimenko/followers","following_url":"https://api.github.com/users/jefimenko/following{/other_user}","gists_url":"https://api.github.com/users/jefimenko/gists{/gist_id}","starred_url":"https://api.github.com/users/jefimenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefimenko/subscriptions","organizations_url":"https://api.github.com/users/jefimenko/orgs","repos_url":"https://api.github.com/users/jefimenko/repos","events_url":"https://api.github.com/users/jefimenko/events{/privacy}","received_events_url":"https://api.github.com/users/jefimenko/received_events","type":"User","site_admin":false},"repo":{"id":30579196,"name":"network_tools","full_name":"jefimenko/network_tools","owner":{"login":"jefimenko","id":3172658,"avatar_url":"https://avatars.githubusercontent.com/u/3172658?v=3","gravatar_id":"","url":"https://api.github.com/users/jefimenko","html_url":"https://github.com/jefimenko","followers_url":"https://api.github.com/users/jefimenko/followers","following_url":"https://api.github.com/users/jefimenko/following{/other_user}","gists_url":"https://api.github.com/users/jefimenko/gists{/gist_id}","starred_url":"https://api.github.com/users/jefimenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefimenko/subscriptions","organizations_url":"https://api.github.com/users/jefimenko/orgs","repos_url":"https://api.github.com/users/jefimenko/repos","events_url":"https://api.github.com/users/jefimenko/events{/privacy}","received_events_url":"https://api.github.com/users/jefimenko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jefimenko/network_tools","description":"","fork":false,"url":"https://api.github.com/repos/jefimenko/network_tools","forks_url":"https://api.github.com/repos/jefimenko/network_tools/forks","keys_url":"https://api.github.com/repos/jefimenko/network_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jefimenko/network_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jefimenko/network_tools/teams","hooks_url":"https://api.github.com/repos/jefimenko/network_tools/hooks","issue_events_url":"https://api.github.com/repos/jefimenko/network_tools/issues/events{/number}","events_url":"https://api.github.com/repos/jefimenko/network_tools/events","assignees_url":"https://api.github.com/repos/jefimenko/network_tools/assignees{/user}","branches_url":"https://api.github.com/repos/jefimenko/network_tools/branches{/branch}","tags_url":"https://api.github.com/repos/jefimenko/network_tools/tags","blobs_url":"https://api.github.com/repos/jefimenko/network_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jefimenko/network_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jefimenko/network_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/jefimenko/network_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jefimenko/network_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/jefimenko/network_tools/languages","stargazers_url":"https://api.github.com/repos/jefimenko/network_tools/stargazers","contributors_url":"https://api.github.com/repos/jefimenko/network_tools/contributors","subscribers_url":"https://api.github.com/repos/jefimenko/network_tools/subscribers","subscription_url":"https://api.github.com/repos/jefimenko/network_tools/subscription","commits_url":"https://api.github.com/repos/jefimenko/network_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/jefimenko/network_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/jefimenko/network_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/jefimenko/network_tools/issues/comments/{number}","contents_url":"https://api.github.com/repos/jefimenko/network_tools/contents/{+path}","compare_url":"https://api.github.com/repos/jefimenko/network_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jefimenko/network_tools/merges","archive_url":"https://api.github.com/repos/jefimenko/network_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jefimenko/network_tools/downloads","issues_url":"https://api.github.com/repos/jefimenko/network_tools/issues{/number}","pulls_url":"https://api.github.com/repos/jefimenko/network_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/jefimenko/network_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/jefimenko/network_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jefimenko/network_tools/labels{/name}","releases_url":"https://api.github.com/repos/jefimenko/network_tools/releases{/id}","created_at":"2015-02-10T06:53:26Z","updated_at":"2015-02-15T08:44:19Z","pushed_at":"2015-02-16T13:59:10Z","git_url":"git://github.com/jefimenko/network_tools.git","ssh_url":"git@github.com:jefimenko/network_tools.git","clone_url":"https://github.com/jefimenko/network_tools.git","svn_url":"https://github.com/jefimenko/network_tools","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"jefimenko:master","ref":"master","sha":"9b463b82a0dfe3e5a166f888c5b96ed2ddfaad29","user":{"login":"jefimenko","id":3172658,"avatar_url":"https://avatars.githubusercontent.com/u/3172658?v=3","gravatar_id":"","url":"https://api.github.com/users/jefimenko","html_url":"https://github.com/jefimenko","followers_url":"https://api.github.com/users/jefimenko/followers","following_url":"https://api.github.com/users/jefimenko/following{/other_user}","gists_url":"https://api.github.com/users/jefimenko/gists{/gist_id}","starred_url":"https://api.github.com/users/jefimenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefimenko/subscriptions","organizations_url":"https://api.github.com/users/jefimenko/orgs","repos_url":"https://api.github.com/users/jefimenko/repos","events_url":"https://api.github.com/users/jefimenko/events{/privacy}","received_events_url":"https://api.github.com/users/jefimenko/received_events","type":"User","site_admin":false},"repo":{"id":30579196,"name":"network_tools","full_name":"jefimenko/network_tools","owner":{"login":"jefimenko","id":3172658,"avatar_url":"https://avatars.githubusercontent.com/u/3172658?v=3","gravatar_id":"","url":"https://api.github.com/users/jefimenko","html_url":"https://github.com/jefimenko","followers_url":"https://api.github.com/users/jefimenko/followers","following_url":"https://api.github.com/users/jefimenko/following{/other_user}","gists_url":"https://api.github.com/users/jefimenko/gists{/gist_id}","starred_url":"https://api.github.com/users/jefimenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefimenko/subscriptions","organizations_url":"https://api.github.com/users/jefimenko/orgs","repos_url":"https://api.github.com/users/jefimenko/repos","events_url":"https://api.github.com/users/jefimenko/events{/privacy}","received_events_url":"https://api.github.com/users/jefimenko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jefimenko/network_tools","description":"","fork":false,"url":"https://api.github.com/repos/jefimenko/network_tools","forks_url":"https://api.github.com/repos/jefimenko/network_tools/forks","keys_url":"https://api.github.com/repos/jefimenko/network_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jefimenko/network_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jefimenko/network_tools/teams","hooks_url":"https://api.github.com/repos/jefimenko/network_tools/hooks","issue_events_url":"https://api.github.com/repos/jefimenko/network_tools/issues/events{/number}","events_url":"https://api.github.com/repos/jefimenko/network_tools/events","assignees_url":"https://api.github.com/repos/jefimenko/network_tools/assignees{/user}","branches_url":"https://api.github.com/repos/jefimenko/network_tools/branches{/branch}","tags_url":"https://api.github.com/repos/jefimenko/network_tools/tags","blobs_url":"https://api.github.com/repos/jefimenko/network_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jefimenko/network_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jefimenko/network_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/jefimenko/network_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jefimenko/network_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/jefimenko/network_tools/languages","stargazers_url":"https://api.github.com/repos/jefimenko/network_tools/stargazers","contributors_url":"https://api.github.com/repos/jefimenko/network_tools/contributors","subscribers_url":"https://api.github.com/repos/jefimenko/network_tools/subscribers","subscription_url":"https://api.github.com/repos/jefimenko/network_tools/subscription","commits_url":"https://api.github.com/repos/jefimenko/network_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/jefimenko/network_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/jefimenko/network_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/jefimenko/network_tools/issues/comments/{number}","contents_url":"https://api.github.com/repos/jefimenko/network_tools/contents/{+path}","compare_url":"https://api.github.com/repos/jefimenko/network_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jefimenko/network_tools/merges","archive_url":"https://api.github.com/repos/jefimenko/network_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jefimenko/network_tools/downloads","issues_url":"https://api.github.com/repos/jefimenko/network_tools/issues{/number}","pulls_url":"https://api.github.com/repos/jefimenko/network_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/jefimenko/network_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/jefimenko/network_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jefimenko/network_tools/labels{/name}","releases_url":"https://api.github.com/repos/jefimenko/network_tools/releases{/id}","created_at":"2015-02-10T06:53:26Z","updated_at":"2015-02-15T08:44:19Z","pushed_at":"2015-02-16T13:59:10Z","git_url":"git://github.com/jefimenko/network_tools.git","ssh_url":"git@github.com:jefimenko/network_tools.git","clone_url":"https://github.com/jefimenko/network_tools.git","svn_url":"https://github.com/jefimenko/network_tools","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jefimenko/network_tools/pulls/2"},"html":{"href":"https://github.com/jefimenko/network_tools/pull/2"},"issue":{"href":"https://api.github.com/repos/jefimenko/network_tools/issues/2"},"comments":{"href":"https://api.github.com/repos/jefimenko/network_tools/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/jefimenko/network_tools/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/jefimenko/network_tools/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jefimenko/network_tools/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/jefimenko/network_tools/statuses/147e0ada0f483f2d3537de5d42f56b728ed16506"}}}}