Page not found on Django using Websockets

It’s the first time I’m working with websockets in Django and I’m not doing it very well, what’s happening to me is that I get either the 404 not found error or the error: unexpected server response: 200, I’ve been checking some tutorials and also reading the documentation and some say to use typeScript but I don’t really understand why

Objective

My goal is to be able to make a request to Electron so it can take a print-screen of your user’s screen and send it to me as a string so I can manipulate it in Django Python, this part is already functional, I tested it with Simple WebSockets Client, but now that I’m trying to test with other users and get their screenshot, and for that I’m using ngrok to keep the server up for other users to access. What happens is that I capture my electronic server and not the other’s my users, and now I’m going to try to change the Routes to capture theirs but I’m not succeeding, if anyone can help a lot

index.js

const { desktopCapturer, screen, BrowserWindow, app } = require('electron');
const { spawn } = require('child_process');
const django = spawn('python', ['manage.py', 'runserver']);
const wss = new WebSocket.Server({ port: 8000 });

wss.on('connection', ws => {
    ws.on('message', message => {
        console.log('Mensagem recebida:', message.toString());
        if (message.toString() === 'screenshot_requested') {
            captureScreenshots(ws);
        }
    });
});


function createWindow() {
    // Create the browser window
    const mainWindow = new BrowserWindow({
        title: 'SketchPixel Facial Recognition',
        width: 1920,
        height: 1680,
        icon: 'templates/static/assets/sketchpixel_logo.jpg'
    });

    // Carregar a URL do aplicativo
    const appUrl = 'https://35f8-2001-8a0-ff62-e300-d469-e0a-17a0-b9bd.ngrok-free.app/';
    mainWindow.loadURL(appUrl);

    // Definir a janela para ser fullscreen
}

django.stdout.on('data', (data) => {  
    console.log(`stdout: ${data}`);
  }
);
django.stderr.on('data', (data) => {
    console.error(`stderr: ${data}`);
  }
);
django.on('close', (code) => {
    console.log(`child process exited with code ${code}`);
  }
);

Consumers.py

 from channels.generic.websocket import AsyncWebsocketConsumer
    import json
    
    class ScreenshotConsumer(AsyncWebsocketConsumer):
        async def connect(self):
            await self.accept()
    
        async def disconnect(self, close_code):
            pass
    
        async def receive(self, text_data):
            text_data_json = json.loads(text_data)
            message = text_data_json['message']
    
            await self.send(text_data=json.dumps({
                'message': message
            }))

   ## Routing.py ##

    from django.urls import re_path
    
    from . import consumers
    
    websocket_urlpatterns = [
        re_path(r'ws/main/', consumers.ScreenshotConsumer.as_asgi()),
    ]

views.py

def call_node_script(request): #Função para chamar o script Node.js

    print("Solicitando captura de tela...")
    ws = websocket.create_connection('wss://35f8-2001-8a0-ff62-e300-d469-e0a-17a0-b9bd.ngrok-free.app/ws/main/') 
    print("Conexão WebSocket estabelecida com sucesso.")
    ws.send('screenshot_requested')
    # Receber a resposta do servidor
    result = ws.recv()
    ws.close()
    print("Resposta Recebida com sucesso.")
    return result

asgi.py

 import os
    from django.core.asgi import get_asgi_application
    from channels.routing import ProtocolTypeRouter, URLRouter
    from channels.auth import AuthMiddlewareStack
    from django.urls import re_path
    from main import consumers
    
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'facial.settings')
    
    websocket_urlpatterns = [
        re_path(r'ws/screenshot/', consumers.ScreenshotConsumer.as_asgi()),
    ]
    
    application = ProtocolTypeRouter({
        "http": get_asgi_application(),
        "websocket": AuthMiddlewareStack(
            URLRouter(
                websocket_urlpatterns
            )
        ),
        # Just HTTP for now. (We can add other protocols later.)
    })

Terminal Django

Handshake status 200 OK -+-+-

Handshake status 404 Not Found -+-+-

Electron

update Required

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật