Code Monkey home page Code Monkey logo

Comments (6)

diegocpires avatar diegocpires commented on May 22, 2024

Replacing DEBUG_WEBSOCKETS with Serial.println i can see the moment of error.

When call function acceptKey. The validation it is not working.

From Firefox I connect in WebSocket Server. Any ideas for resolve this problem?

from arduinowebsockets.

diegocpires avatar diegocpires commented on May 22, 2024

For Example

For send Web-Socket-Key 17Gf8QiZr8lDr/aU9ePVFQ== the correct Sec-WebSocket-Accept is rssLO9/Rz1QGFYktqTxzJ5viYUc=, but the function acceptKey returns Kfh9QIsMVZcl6xEPYxPHzW8SZ8w=

from arduinowebsockets.

Links2004 avatar Links2004 commented on May 22, 2024

do you use the ESP8266 or a ATmega?
for ESP8266 will work:

/// Serial
#define DEBUG_WEBSOCKETS(...) Serial.printf( __VA_ARGS__ )
/// Serial1
#define DEBUG_WEBSOCKETS(...) Serial1.printf( __VA_ARGS__ )

the avr not support printf for print class.
but you can use printf.

#include <stdio.h>
static FILE uartout = {0} ;
static int uart_putchar (char c, FILE *stream)
{
    Serial.write(c) ;
    return 0 ;
}

void setup(void)
{
   Serial.begin(115200);
   fdev_setup_stream (&uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE);
   stdout = &uartout ;
}
#define DEBUG_WEBSOCKETS(...) printf( __VA_ARGS__ )

with printf you will see the acceptKey that is send to the server and the AcceptKey

from arduinowebsockets.

diegocpires avatar diegocpires commented on May 22, 2024

Hi @Links2004, thanks for the answer.
Im using ATmega with AVR.

But, replacing and testing, I got the problem above.
#38 (comment)

from arduinowebsockets.

Links2004 avatar Links2004 commented on May 22, 2024

try to change
https://github.com/Links2004/arduinoWebSockets/blob/master/src/WebSockets.cpp#L400
too:

    clientKey += "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";

look like the + and = are mixed

from arduinowebsockets.

diegocpires avatar diegocpires commented on May 22, 2024

Wow @Links2004 .

This Works like a charm! Very Very Thanks.

Can i close this issue?

from arduinowebsockets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.