You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenGL Version: 3.1.0 - Build 9.17.10.4459
[2023-01-05 13:27:08] [connect] Successful connection
[2023-01-05 13:27:08] [connect] WebSocket Connection 127.0.0.1:3000 v-2 "WebSocket++/0.8.2" /socket.io/?EIO=3&transport=websocket&t=1672910828 101
[2023-01-05 13:27:08] [error] consume error: websocketpp.processor:9 (Invalid use of reserved bits)
[2023-01-05 13:27:08] [disconnect] Disconnect close local:[1002,Invalid use of reserved bits] remote:[1006]
[2023-01-05 13:27:13] [connect] Successful connection
[2023-01-05 13:27:13] [connect] WebSocket Connection 127.0.0.1:3000 v-2 "WebSocket++/0.8.2" /socket.io/?EIO=3&transport=websocket&t=1672910833 101
[2023-01-05 13:27:13] [error] consume error: websocketpp.processor:9 (Invalid use of reserved bits)
[2023-01-05 13:27:13] [disconnect] Disconnect close local:[1002,Invalid use of reserved bits] remote:[1006]
main.cpp
#include<glad/glad.h>
#include<iostream>
#defineSDL_MAIN_HANDLED
#include<SDL2/SDL.h>
#defineSIO_TLS
#include<sio_client.h>constint WIDTH = 400, HEIGHT = 400;
constfloat maxFPS = 60.f;
intmain()
{
// Init SDL2if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
std::cout << SDL_GetError << std::endl;
exit(EXIT_FAILURE);
}
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_Window *window = SDL_CreateWindow("CG_P4", SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, WIDTH, HEIGHT, SDL_WINDOW_OPENGL);
if (!window)
{
std::cout << SDL_GetError << std::endl;
SDL_Quit();
exit(EXIT_FAILURE);
}
SDL_GLContext glContext = SDL_GL_CreateContext(window);
if (!glContext)
{
std::cout << SDL_GetError << std::endl;
SDL_Quit();
exit(EXIT_FAILURE);
}
// Initialize GLAD to set up the OpenGL Function pointersif (!gladLoadGL())
{
std::cout << "Failed to initialize the GLAD library" << std::endl;
SDL_Quit();
exit(EXIT_FAILURE);
}
std::cout << "OpenGL Version: " << glGetString(GL_VERSION) << std::endl;
// Set background colorglClearColor(0.875f, 0.875f, 0.875f, 0.f);
// Define the viewport dimensionsglViewport(0, 0, WIDTH, HEIGHT);
sio::client h;
h.connect("https://127.0.0.1:3000");
// h.connect("wss://connection-js.onrender.com/");// h.connect("wss://hungry-mighty-hospital.glitch.me");bool running = true;
while (running)
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
running = false;
break;
}
}
float startTicks = SDL_GetTicks();
glClear(GL_COLOR_BUFFER_BIT);
SDL_GL_SwapWindow(window);
// Limit FPS to the max FPSfloat frameTicks = SDL_GetTicks() - startTicks;
if (1000.f / maxFPS > frameTicks)
{
SDL_Delay(1000.f / maxFPS - frameTicks);
}
}
return0;
}
app.js:
constexpress=require("express");constio=require("socket.io")();consthttp=require("http");constpath=require("path");constapp=express();app.use(express.static(path.join(process.cwd(),"public")));consthttpServer=http.createServer(app);constport=process.env.PORT||3000;httpServer.listen(port,()=>console.log("Listening at port: "+port));constsio=io.listen(httpServer);sio.sockets.on("connection",(socket)=>{console.log("client was connected");});
The text was updated successfully, but these errors were encountered:
8Observer8
changed the title
Server handshake response error: websocketpp.processor:20
My stupid mistake guys. Please, delete it.
Dec 26, 2022
8Observer8
changed the title
My stupid mistake, guys. Please, delete it.
[error] consume error: websocketpp.processor:9 (Invalid use of reserved bits)
Jan 5, 2023
It should be noted that the connection occurs if ws is used on the server side instead of socket.io
constexpress=require("express");consthttp=require("http");constws=require("ws");constpath=require("path");constapp=express();consthttpServer=http.createServer(app);constwss=newws.Server({server: httpServer});constport=process.env.PORT||3000;httpServer.listen(port,()=>console.log("Listening at port: "+port));wss.on("connection",socket=>{console.log("client was connected");});
I tried to connect locally but got this error:
main.cpp
app.js:
The text was updated successfully, but these errors were encountered: