{"action":"opened","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/792","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/792/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/792/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/792/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/792","id":359242837,"node_id":"MDU6SXNzdWUzNTkyNDI4Mzc=","number":792,"title":"socket with route to redirect message to another page","user":{"login":"rupesh2017","id":31857722,"node_id":"MDQ6VXNlcjMxODU3NzIy","avatar_url":"https://avatars3.githubusercontent.com/u/31857722?v=4","gravatar_id":"","url":"https://api.github.com/users/rupesh2017","html_url":"https://github.com/rupesh2017","followers_url":"https://api.github.com/users/rupesh2017/followers","following_url":"https://api.github.com/users/rupesh2017/following{/other_user}","gists_url":"https://api.github.com/users/rupesh2017/gists{/gist_id}","starred_url":"https://api.github.com/users/rupesh2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupesh2017/subscriptions","organizations_url":"https://api.github.com/users/rupesh2017/orgs","repos_url":"https://api.github.com/users/rupesh2017/repos","events_url":"https://api.github.com/users/rupesh2017/events{/privacy}","received_events_url":"https://api.github.com/users/rupesh2017/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-11T22:09:38Z","updated_at":"2018-09-11T22:09:38Z","closed_at":null,"author_association":"NONE","body":"import os\r\nimport requests\r\n\r\nfrom flask import Flask,jsonify,render_template,request\r\nfrom flask_socketio import SocketIO,emit,join_room,leave_room,send\r\n\r\nfrom werkzeug import secure_filename\r\n\r\napp = Flask(__name__)\r\napp.config[\"SECRET_KEY\"] = os.getenv(\"SECRET_KEY\")\r\nsocketio=SocketIO(app)\r\n\r\n\r\n@app.route(\"/\")\r\ndef index():\r\n    return render_template(\"index.html\")\r\n\r\n\r\n@app.route(\"/chat\")    \r\n@socketio.on('join')\r\ndef on_join(data):\r\n    username = data['user']\r\n    room = data['room']\r\n    join_room(room)\r\n    emit('chat',{'username':username},room=room)\r\n    return render_template(\"chat.html\")\r\n    \r\n\r\n# I have 2 html ( one user name and room name to join) and other for message(chat.html)\r\n# when I **click on join** on index.html i like to _go to chat route_ with  message emitted"}}
{"actor":{"display_login":"rupesh2017"}}