A PHP Error was encountered

Severity: Warning

Message: fopen(/var/lib/php/sessions/ci_session99ff77f1d21d2c63327fcf5ab4cd22e2ac1dad6b): failed to open stream: No space left on device

Filename: drivers/Session_files_driver.php

Line Number: 156

Backtrace:

File: /var/www/prijm.com/public/application/core/Prijom_Controller.php
Line: 6
Function: __construct

File: /var/www/prijm.com/public/application/controllers/Discussion.php
Line: 11
Function: __construct

File: /var/www/prijm.com/public/index.php
Line: 292
Function: require_once

Socket.io not connecting through localhost

join the prijm community

prijm is a community of people, just like you helping each other.
join them, it only takes a minute :)

Socket.io not connecting through localhost

Hi, I was watching this video: (18) Real Time Python Chat Application using Python Flask SocketIO - YouTube

When I reach the point to check if my ChatAppPage.html is showing "user connected" in the console but instead it keeps giving me this error: Failed to load http://localhost/socket.io/?EIO=3&transport=polling&t=L_Nbg2Y: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.


My code for chatapp.py:

from flask import Flask, render_template

from flask_socketio import SocketIO, emit


app = Flask(__name__)


app.config[ 'SECRET_KEY' ] = 'Abbas'


socketio = SocketIO( app )


@app.route( '/' )

def index():

    return render_template( './ChatAppPage.html' )


@socketio.on( 'An Event' )

def handle_my_custom_event( json ):

socketio.emit( 'my response', json )


if __name__ == '__main__':

    socketio.run( app, debug = True )

my code from ChatAppPage.html:

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

    [removed][removed]

    [removed][removed]

    [removed][removed]

    

    [removed]

    // broadcast a message

    socket.emit( 'An Event', {

    })

    var form = $( 'form' ).on( 'submit', function( e ) {

    var user_name = $( 'input.username' ).val()

    console.log( user_name, message )

    // capture message

    console.log( msg )

    } ) 

    [removed]


  </body></p>

</html></p>I have tried to add in different ports like 8000 and 3001 and 5000 but nothing seems to be working, its not being able to connect to socket.io at all. Please help!



0 0
please login or signup to reply
post a reply
discussion resolution do more with this discussion
followed by 1 user added by 0 user save this discussion to reply later make this discussion anonymous
discussion stats
views: 297
replies: 0
favorites: 0
follower: 1
saved: 0
comments: 0

A PHP Error was encountered

Severity: Warning

Message: rewind() expects parameter 1 to be resource, boolean given

Filename: drivers/Session_files_driver.php

Line Number: 188

Backtrace:

A PHP Error was encountered

Severity: Warning

Message: filesize(): stat failed for /var/lib/php/sessions/ci_session99ff77f1d21d2c63327fcf5ab4cd22e2ac1dad6b

Filename: drivers/Session_files_driver.php

Line Number: 192

Backtrace: