Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

this is not even working at all #22

@ahmetkca

Description

@ahmetkca

main.py

from fastapi import FastAPI
from fastapi_socketio import SocketManager

app = FastAPI()
socket_manager = SocketManager(app=app)


@app.get("/")
async def root():
    return {"message": "Hello World"}


@app.sio.on('connect')
async def handle_connect(sid, *args, **kwargs):
    await app.sio.emit('connect', 'User joined')

CLIENT SIDE

import {io} from 'socket.io-client';

const socket =  io('ws://127.0.0.1:8000', {
      path: 'ws/socket.io',
      autoConnect: true
  })

  socket.on('connect', (data) => {
    console.log(data)
  })``` 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions