I'm not getting response in socket from flask server2019 Community Moderator ElectionHow to get the value from the GET parameters?Get selected text from a drop-down list (select box) using jQueryHow to get data received in Flask requestjQuery Get Selected Option From DropdownReturn JSON response from Flask viewHow do I return the response from an asynchronous call?Flask doesn't redirectFlask form is not returnedPython flask socketio at ubuntu 16.04(transport=pooling error)Nginx not working with socket.io on production server
Good allowance savings plan?
What is a good source for large tables on the properties of water?
Professor being mistaken for a grad student
At what level can a dragon innately cast its spells?
Possible Leak In Concrete
Is a lawful good "antagonist" effective?
How to simplify this time periods definition interface?
Why is stat::st_size 0 for devices but at the same time lseek defines the device size correctly?
Meaning of "SEVERA INDEOVI VAS" from 3rd Century slab
My story is written in English, but is set in my home country. What language should I use for the dialogue?
Is it normal that my co-workers at a fitness company criticize my food choices?
Make a transparent 448*448 image
My adviser wants to be the first author
Counting certain elements in lists
In-house repeater?
Rules about breaking the rules. How do I do it well?
Font with correct density?
An Accountant Seeks the Help of a Mathematician
How could a female member of a species produce eggs unto death?
What has been your most complicated TikZ drawing?
How to deal with a cynical class?
Brexit - No Deal Rejection
Does this AnyDice function accurately calculate the number of ogres you make unconcious with three 4th-level castings of Sleep?
Why do passenger jet manufacturers design their planes with stall prevention systems?
I'm not getting response in socket from flask server
2019 Community Moderator ElectionHow to get the value from the GET parameters?Get selected text from a drop-down list (select box) using jQueryHow to get data received in Flask requestjQuery Get Selected Option From DropdownReturn JSON response from Flask viewHow do I return the response from an asynchronous call?Flask doesn't redirectFlask form is not returnedPython flask socketio at ubuntu 16.04(transport=pooling error)Nginx not working with socket.io on production server
I'm working on socket.io module in flask and I'm not getting a response in the socket after pressing yes, no or maybe button
Here is my code
html code
> <!DOCTYPE html>
> <html>
> <head>
> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
> <script type="text/javascript" src=" url_for('static', filename='index.js') "></script>
> <title>Vote</title>
> </head>
> <body>
> <ul id="votes">
> </ul>
> <hr>
> <button data-vote="yes">Yes</button>
> <button data-vote="no">No</button>
> <button data-vote="maybe">Maybe</button>
> </body>
> </html>
This is my js code
document.addEventListener('DOMContentLoaded', () =>
// Connect to websocket
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port);
// When connected, configure buttons
socket.on('connect', () =>
// Each button should emit a "submit vote" event
document.querySelectorAll('button').forEach(button =>
button.onclick = () =>
const selection = button.dataset.vote;
socket.emit('submit vote', 'selection': selection);
;
);
);
// When a new vote is announced, add to the unordered list
socket.on('announce vote', data =>
const li = document.createElement('li');
li.innerHTML = `Vote recorded: $data.selection`;
document.querySelector('#votes').append(li);
);
);
This is my python code
import os
import requests
from flask import Flask, jsonify, render_template, request
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY")
socketio = SocketIO(app)
@app.route("/")
def index():
return render_template("index.html")
@socketio.on("submit vote")
def vote(data):
selection = data["selection"]
emit("announce vote", "selection": selection, broadcast=True)
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET /static/index.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336110-0 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336245-1&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896337783-2&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896396273-3&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:57] "GET /socket.io/?EIO=3&transport=polling&t=1551896397551-4 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896397576-5&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896423047-6&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896456270-7&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896457043-8&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:59] "GET /socket.io/?EIO=3&transport=polling&t=1551896459040-9 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896459067-10&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896485040-11&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896516257-12&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896517043-13&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:58] "GET /socket.io/?EIO=3&transport=polling&t=1551896518044-14 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896518072-15&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896544039-16&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 400 -
javascript sockets flask socket.io
add a comment |
I'm working on socket.io module in flask and I'm not getting a response in the socket after pressing yes, no or maybe button
Here is my code
html code
> <!DOCTYPE html>
> <html>
> <head>
> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
> <script type="text/javascript" src=" url_for('static', filename='index.js') "></script>
> <title>Vote</title>
> </head>
> <body>
> <ul id="votes">
> </ul>
> <hr>
> <button data-vote="yes">Yes</button>
> <button data-vote="no">No</button>
> <button data-vote="maybe">Maybe</button>
> </body>
> </html>
This is my js code
document.addEventListener('DOMContentLoaded', () =>
// Connect to websocket
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port);
// When connected, configure buttons
socket.on('connect', () =>
// Each button should emit a "submit vote" event
document.querySelectorAll('button').forEach(button =>
button.onclick = () =>
const selection = button.dataset.vote;
socket.emit('submit vote', 'selection': selection);
;
);
);
// When a new vote is announced, add to the unordered list
socket.on('announce vote', data =>
const li = document.createElement('li');
li.innerHTML = `Vote recorded: $data.selection`;
document.querySelector('#votes').append(li);
);
);
This is my python code
import os
import requests
from flask import Flask, jsonify, render_template, request
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY")
socketio = SocketIO(app)
@app.route("/")
def index():
return render_template("index.html")
@socketio.on("submit vote")
def vote(data):
selection = data["selection"]
emit("announce vote", "selection": selection, broadcast=True)
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET /static/index.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336110-0 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336245-1&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896337783-2&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896396273-3&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:57] "GET /socket.io/?EIO=3&transport=polling&t=1551896397551-4 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896397576-5&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896423047-6&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896456270-7&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896457043-8&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:59] "GET /socket.io/?EIO=3&transport=polling&t=1551896459040-9 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896459067-10&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896485040-11&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896516257-12&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896517043-13&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:58] "GET /socket.io/?EIO=3&transport=polling&t=1551896518044-14 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896518072-15&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896544039-16&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 400 -
javascript sockets flask socket.io
add a comment |
I'm working on socket.io module in flask and I'm not getting a response in the socket after pressing yes, no or maybe button
Here is my code
html code
> <!DOCTYPE html>
> <html>
> <head>
> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
> <script type="text/javascript" src=" url_for('static', filename='index.js') "></script>
> <title>Vote</title>
> </head>
> <body>
> <ul id="votes">
> </ul>
> <hr>
> <button data-vote="yes">Yes</button>
> <button data-vote="no">No</button>
> <button data-vote="maybe">Maybe</button>
> </body>
> </html>
This is my js code
document.addEventListener('DOMContentLoaded', () =>
// Connect to websocket
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port);
// When connected, configure buttons
socket.on('connect', () =>
// Each button should emit a "submit vote" event
document.querySelectorAll('button').forEach(button =>
button.onclick = () =>
const selection = button.dataset.vote;
socket.emit('submit vote', 'selection': selection);
;
);
);
// When a new vote is announced, add to the unordered list
socket.on('announce vote', data =>
const li = document.createElement('li');
li.innerHTML = `Vote recorded: $data.selection`;
document.querySelector('#votes').append(li);
);
);
This is my python code
import os
import requests
from flask import Flask, jsonify, render_template, request
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY")
socketio = SocketIO(app)
@app.route("/")
def index():
return render_template("index.html")
@socketio.on("submit vote")
def vote(data):
selection = data["selection"]
emit("announce vote", "selection": selection, broadcast=True)
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET /static/index.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336110-0 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336245-1&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896337783-2&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896396273-3&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:57] "GET /socket.io/?EIO=3&transport=polling&t=1551896397551-4 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896397576-5&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896423047-6&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896456270-7&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896457043-8&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:59] "GET /socket.io/?EIO=3&transport=polling&t=1551896459040-9 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896459067-10&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896485040-11&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896516257-12&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896517043-13&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:58] "GET /socket.io/?EIO=3&transport=polling&t=1551896518044-14 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896518072-15&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896544039-16&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 400 -
javascript sockets flask socket.io
I'm working on socket.io module in flask and I'm not getting a response in the socket after pressing yes, no or maybe button
Here is my code
html code
> <!DOCTYPE html>
> <html>
> <head>
> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
> <script type="text/javascript" src=" url_for('static', filename='index.js') "></script>
> <title>Vote</title>
> </head>
> <body>
> <ul id="votes">
> </ul>
> <hr>
> <button data-vote="yes">Yes</button>
> <button data-vote="no">No</button>
> <button data-vote="maybe">Maybe</button>
> </body>
> </html>
This is my js code
document.addEventListener('DOMContentLoaded', () =>
// Connect to websocket
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port);
// When connected, configure buttons
socket.on('connect', () =>
// Each button should emit a "submit vote" event
document.querySelectorAll('button').forEach(button =>
button.onclick = () =>
const selection = button.dataset.vote;
socket.emit('submit vote', 'selection': selection);
;
);
);
// When a new vote is announced, add to the unordered list
socket.on('announce vote', data =>
const li = document.createElement('li');
li.innerHTML = `Vote recorded: $data.selection`;
document.querySelector('#votes').append(li);
);
);
This is my python code
import os
import requests
from flask import Flask, jsonify, render_template, request
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY")
socketio = SocketIO(app)
@app.route("/")
def index():
return render_template("index.html")
@socketio.on("submit vote")
def vote(data):
selection = data["selection"]
emit("announce vote", "selection": selection, broadcast=True)
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:55] "GET /static/index.js HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:48:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336110-0 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896336245-1&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896337783-2&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896396273-3&sid=7d3a45fe719e4e92a2b60728ff734cdf
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:49:57] "GET /socket.io/?EIO=3&transport=polling&t=1551896397551-4 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896397576-5&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896423047-6&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896456270-7&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896457043-8&sid=42e86974ded740ed8ee99266e917048e
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:50:59] "GET /socket.io/?EIO=3&transport=polling&t=1551896459040-9 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896459067-10&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896485040-11&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896516257-12&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:57] "POST /socket.io/?EIO=3&transport=polling&t=1551896517043-13&sid=b782019c299b4bc5a913934763b09059
HTTP/1.1" 400 -
127.0.0.1 - - [06/Mar/2019 23:51:58] "GET /socket.io/?EIO=3&transport=polling&t=1551896518044-14 HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "GET /socket.io/?EIO=3&transport=polling&t=1551896518072-15&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 200 -
127.0.0.1 - - [06/Mar/2019 23:52:56] "POST /socket.io/?EIO=3&transport=polling&t=1551896544039-16&sid=62c3c894db304b538f830b5036e42b6c
HTTP/1.1" 400 -
javascript sockets flask socket.io
javascript sockets flask socket.io
asked Mar 6 at 18:39
Hemendra KhatikHemendra Khatik
13
13
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Not sure but can you please try
socketio.emit("announce vote", "selection": selection)
It's not working
– Hemendra Khatik
Mar 7 at 10:44
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55030066%2fim-not-getting-response-in-socket-from-flask-server%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Not sure but can you please try
socketio.emit("announce vote", "selection": selection)
It's not working
– Hemendra Khatik
Mar 7 at 10:44
add a comment |
Not sure but can you please try
socketio.emit("announce vote", "selection": selection)
It's not working
– Hemendra Khatik
Mar 7 at 10:44
add a comment |
Not sure but can you please try
socketio.emit("announce vote", "selection": selection)
Not sure but can you please try
socketio.emit("announce vote", "selection": selection)
answered Mar 6 at 18:53
Konuralp ToksoyKonuralp Toksoy
475
475
It's not working
– Hemendra Khatik
Mar 7 at 10:44
add a comment |
It's not working
– Hemendra Khatik
Mar 7 at 10:44
It's not working
– Hemendra Khatik
Mar 7 at 10:44
It's not working
– Hemendra Khatik
Mar 7 at 10:44
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55030066%2fim-not-getting-response-in-socket-from-flask-server%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown