{"action":"closed","issue":{"url":"https://api.github.com/repos/johnlauer/serial-port-json-server/issues/30","labels_url":"https://api.github.com/repos/johnlauer/serial-port-json-server/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/johnlauer/serial-port-json-server/issues/30/comments","events_url":"https://api.github.com/repos/johnlauer/serial-port-json-server/issues/30/events","html_url":"https://github.com/johnlauer/serial-port-json-server/issues/30","id":119366013,"number":30,"title":"Connection refused","user":{"login":"ylh888","id":4082,"avatar_url":"https://avatars.githubusercontent.com/u/4082?v=3","gravatar_id":"","url":"https://api.github.com/users/ylh888","html_url":"https://github.com/ylh888","followers_url":"https://api.github.com/users/ylh888/followers","following_url":"https://api.github.com/users/ylh888/following{/other_user}","gists_url":"https://api.github.com/users/ylh888/gists{/gist_id}","starred_url":"https://api.github.com/users/ylh888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ylh888/subscriptions","organizations_url":"https://api.github.com/users/ylh888/orgs","repos_url":"https://api.github.com/users/ylh888/repos","events_url":"https://api.github.com/users/ylh888/events{/privacy}","received_events_url":"https://api.github.com/users/ylh888/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-29T15:43:47Z","updated_at":"2015-11-29T20:23:47Z","closed_at":"2015-11-29T20:23:47Z","body":"Great program - what I have been looking for.\r\n\r\nI have been successfully used the chilipeppr's hardware fiddle to connect to an Arduino. Send and receive was fine. I then disconnect in chilipeppr and try to use a web socket code to connect. I got the following when I ran the code (below the error message):\r\n```\r\nindex2.html:8 WebSocket is supported by your Browser!\r\nindex2.html:11 WebSocket connection to 'ws://localhost/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\r\nindex2.html:28 Connection is closed...\r\n```\r\n\r\nindex2.html is simply:\r\n```\r\n<!DOCTYPE HTML>\r\n<html>\r\n\r\n<head>\r\n  <script type=\"text/javascript\">\r\n    function WebSocketTest() {\r\n      if (\"WebSocket\" in window) {\r\n        console.log(\"WebSocket is supported by your Browser!\");\r\n\r\n        // Let us open a web socket\r\n        var ws = new WebSocket(\"ws://localhost/ws\");\r\n\r\n        ws.onopen = function () {\r\n          // Web Socket is connected, send data using send()\r\n          ws.send(\"list\");\r\n          console.log(\"sending list\");\r\n        };\r\n\r\n        ws.onmessage = function (evt) {\r\n          var received_msg = evt.data;\r\n          console.log(\"Message is received...\");\r\n          console.log(evt.data);\r\n        };\r\n\r\n        ws.onclose = function () {\r\n          // websocket is closed.\r\n          console.log(\"Connection is closed...\");\r\n        };\r\n      } else {\r\n        // The browser doesn't support WebSocket\r\n        console.log(\"WebSocket NOT supported by your Browser!\");\r\n      }\r\n    }\r\n  </script>\r\n</head>\r\n\r\n<body>\r\n\r\n  <div id=\"sse\">\r\n    <a href=\"javascript:WebSocketTest()\">Run WebSocket</a>\r\n  </div>\r\n</body>\r\n\r\n</html>\r\n```"}}