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










0















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 -











share|improve this question


























    0















    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 -











    share|improve this question
























      0












      0








      0








      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 -











      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 6 at 18:39









      Hemendra KhatikHemendra Khatik

      13




      13






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Not sure but can you please try



          socketio.emit("announce vote", "selection": selection)





          share|improve this answer























          • It's not working

            – Hemendra Khatik
            Mar 7 at 10:44










          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          Not sure but can you please try



          socketio.emit("announce vote", "selection": selection)





          share|improve this answer























          • It's not working

            – Hemendra Khatik
            Mar 7 at 10:44















          0














          Not sure but can you please try



          socketio.emit("announce vote", "selection": selection)





          share|improve this answer























          • It's not working

            – Hemendra Khatik
            Mar 7 at 10:44













          0












          0








          0







          Not sure but can you please try



          socketio.emit("announce vote", "selection": selection)





          share|improve this answer













          Not sure but can you please try



          socketio.emit("announce vote", "selection": selection)






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 6 at 18:53









          Konuralp ToksoyKonuralp Toksoy

          475




          475












          • 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





          It's not working

          – Hemendra Khatik
          Mar 7 at 10:44



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved