{"action":"created","issue":{"url":"https://api.github.com/repos/morrissinger/ESP8266-Websocket/issues/18","repository_url":"https://api.github.com/repos/morrissinger/ESP8266-Websocket","labels_url":"https://api.github.com/repos/morrissinger/ESP8266-Websocket/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/morrissinger/ESP8266-Websocket/issues/18/comments","events_url":"https://api.github.com/repos/morrissinger/ESP8266-Websocket/issues/18/events","html_url":"https://github.com/morrissinger/ESP8266-Websocket/issues/18","id":168065217,"number":18,"title":"How to create own websocket server?","user":{"login":"williamesp2015","id":12815126,"avatar_url":"https://avatars2.githubusercontent.com/u/12815126?v=4","gravatar_id":"","url":"https://api.github.com/users/williamesp2015","html_url":"https://github.com/williamesp2015","followers_url":"https://api.github.com/users/williamesp2015/followers","following_url":"https://api.github.com/users/williamesp2015/following{/other_user}","gists_url":"https://api.github.com/users/williamesp2015/gists{/gist_id}","starred_url":"https://api.github.com/users/williamesp2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamesp2015/subscriptions","organizations_url":"https://api.github.com/users/williamesp2015/orgs","repos_url":"https://api.github.com/users/williamesp2015/repos","events_url":"https://api.github.com/users/williamesp2015/events{/privacy}","received_events_url":"https://api.github.com/users/williamesp2015/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-28T10:37:56Z","updated_at":"2018-03-31T20:46:04Z","closed_at":null,"author_association":"NONE","body":"Hi, this is very interesting websocket client. It is working when connecting to echo.websocket.org but if change host url to my url and copy the same echo.websocket into index.html it does not work. Any help would be appreciated.\n"},"comment":{"url":"https://api.github.com/repos/morrissinger/ESP8266-Websocket/issues/comments/377722287","html_url":"https://github.com/morrissinger/ESP8266-Websocket/issues/18#issuecomment-377722287","issue_url":"https://api.github.com/repos/morrissinger/ESP8266-Websocket/issues/18","id":377722287,"user":{"login":"dphans","id":12996976,"avatar_url":"https://avatars3.githubusercontent.com/u/12996976?v=4","gravatar_id":"","url":"https://api.github.com/users/dphans","html_url":"https://github.com/dphans","followers_url":"https://api.github.com/users/dphans/followers","following_url":"https://api.github.com/users/dphans/following{/other_user}","gists_url":"https://api.github.com/users/dphans/gists{/gist_id}","starred_url":"https://api.github.com/users/dphans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dphans/subscriptions","organizations_url":"https://api.github.com/users/dphans/orgs","repos_url":"https://api.github.com/users/dphans/repos","events_url":"https://api.github.com/users/dphans/events{/privacy}","received_events_url":"https://api.github.com/users/dphans/received_events","type":"User","site_admin":false},"created_at":"2018-03-31T20:46:04Z","updated_at":"2018-03-31T20:46:04Z","author_association":"NONE","body":"Below is simple websocket server wrote with __Python 3.6__ (Using `[flask](https://github.com/pallets/flask)` `[Flask-Sockets](https://github.com/kennethreitz/flask-sockets)`), you can preference:\r\n\r\n```python\r\nfrom flask import Flask\r\nfrom flask_sockets import Sockets\r\n\r\n\r\napp = Flask(__name__)\r\nsockets = Sockets(app)\r\n\r\n\r\n@sockets.route('/')\r\ndef echo_socket(ws):\r\n    while not ws.closed:\r\n        message = ws.receive()\r\n        ws.send(message)\r\n\r\n\r\n@app.route('/')\r\ndef hello():\r\n    return 'Server working!'\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    from gevent import pywsgi\r\n    from geventwebsocket.handler import WebSocketHandler\r\n    server = pywsgi.WSGIServer(('', 5000), application=app, handler_class=WebSocketHandler)\r\n    server.serve_forever()\r\n```"}}
{"actor":{"display_login":"dphans"}}