Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make sure to use HttpClient when upgrading the connection for websockets#152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

tim-vandecasteele
Copy link

disclaimer: I'm a bit puzzled by this problem, as everyone should have this problem but then people would have a lot of problems with websockets

Context: I'm using websockets over https, usingWiFiClientSecure

Using WebSocketClient::begin I got into problems wherestatus = responseStatusCode(); would be trying to read the HTTP header, but because both HttpClient and WebSocketClient have a read function, the read from WebSocketClient was used, which returns a bunch of gibberish bytes. This caused the WebSocket to think that the connection was not successfully upgraded, whereas in reality the webserver gave a proper response.

websocketClient = new WebSocketClient(wifiWebsocket, "www.host.com", 443);int ret = websocketClient->begin(websocketPath);

this basically gaveret = -4, becauseresponseStatusCode couldn't find the HTTP header.

Let me know what the structure is to get things merged, or what adaptations are required.

(I tested this on a simple esp32 board)

Using WebSocketClient::begin I got into problems where `status = responseStatusCode();` would be trying to read the HTTP header, but because both HttpClient and WebSocketClient have a read function, the read from WebSocketClient was used, which returns a bunch of gibberish. This caused the WebSocket to think that the connection was not successfully upgraded.
@CLAassistant
Copy link

CLAassistant commentedApr 9, 2023
edited
Loading

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Memory usage change @8566fb4

Boardflash%RAM for global variables%
arduino:samd:mkr1000💚 -8 - 0-0.0 - 0.00 - 00.0 - 0.0
Click for full report table
Boardexamples/BasicAuthGet
flash
%examples/BasicAuthGet
RAM for global variables
%examples/CustomHeader
flash
%examples/CustomHeader
RAM for global variables
%examples/DweetGet
flash
%examples/DweetGet
RAM for global variables
%examples/DweetPost
flash
%examples/DweetPost
RAM for global variables
%examples/HueBlink
flash
%examples/HueBlink
RAM for global variables
%examples/PostWithHeaders
flash
%examples/PostWithHeaders
RAM for global variables
%examples/SimpleDelete
flash
%examples/SimpleDelete
RAM for global variables
%examples/SimpleGet
flash
%examples/SimpleGet
RAM for global variables
%examples/SimpleHttpExample
flash
%examples/SimpleHttpExample
RAM for global variables
%examples/SimplePost
flash
%examples/SimplePost
RAM for global variables
%examples/SimplePut
flash
%examples/SimplePut
RAM for global variables
%examples/SimpleWebSocket
flash
%examples/SimpleWebSocket
RAM for global variables
%
arduino:samd:mkr100000.000.000.000.0-8-0.000.000.000.0-8-0.000.000.000.0-8-0.000.000.000.000.000.000.000.000.000.000.000.0
Click for full report CSV
Board,examples/BasicAuthGet<br>flash,%,examples/BasicAuthGet<br>RAM for global variables,%,examples/CustomHeader<br>flash,%,examples/CustomHeader<br>RAM for global variables,%,examples/DweetGet<br>flash,%,examples/DweetGet<br>RAM for global variables,%,examples/DweetPost<br>flash,%,examples/DweetPost<br>RAM for global variables,%,examples/HueBlink<br>flash,%,examples/HueBlink<br>RAM for global variables,%,examples/PostWithHeaders<br>flash,%,examples/PostWithHeaders<br>RAM for global variables,%,examples/SimpleDelete<br>flash,%,examples/SimpleDelete<br>RAM for global variables,%,examples/SimpleGet<br>flash,%,examples/SimpleGet<br>RAM for global variables,%,examples/SimpleHttpExample<br>flash,%,examples/SimpleHttpExample<br>RAM for global variables,%,examples/SimplePost<br>flash,%,examples/SimplePost<br>RAM for global variables,%,examples/SimplePut<br>flash,%,examples/SimplePut<br>RAM for global variables,%,examples/SimpleWebSocket<br>flash,%,examples/SimpleWebSocket<br>RAM for global variables,%arduino:samd:mkr1000,0,0.0,0,0.0,0,0.0,0,0.0,-8,-0.0,0,0.0,0,0.0,0,0.0,-8,-0.0,0,0.0,0,0.0,0,0.0,-8,-0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@tim-vandecasteele
Copy link
Author

Hi@per1234 are you still maintaining this project?
If so, let me know if there's anything else required, if not, do you prefer that people fork this, or is there a process to find a new maintainer?

@per1234per1234 added type: imperfectionPerceived defect in any part of project topic: codeRelated to content of the project itself labelsApr 12, 2023
@per1234
Copy link

Hi@tim-vandecasteele. Thanks for your pull request!

My role in this project is janitorial. I try to help keep the issue tracker tidy and maintain the infrastructure, but am not in a role to decide on changes to the codebase.

One of the other maintainers will need to take care of the review and merging of this pull request.

@tim-vandecasteele
Copy link
Author

Hi, sorry, I was too quick drawing conclusions from the dependabot merges. Any idea who would be a maintainer for this project then? Looking through the commits there weren't a lot of merges other than these updates in this project.

Sorry to bring these questions to you, not really clear who else should be addressed 😅

per1234 and andersruneson reacted with heart emoji

@andreagilardoniandreagilardoni self-requested a reviewMarch 21, 2024 16:07
@andreagilardoni
Copy link

andreagilardoni commentedMar 21, 2024
edited
Loading

Hi@tim-vandecasteele, I would also addHttpClient:: on this line

write(aBody, aContentLength);
As far as I am aware I cannot suggest a change on that line. I don't see these changes harmful for the repository, I will try them and merge this PR. Thanks for your work!

@andreagilardoniandreagilardoni merged commit0ec8824 intoarduino-libraries:masterMar 25, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@andreagilardoniandreagilardoniAwaiting requested review from andreagilardoni

Assignees
No one assigned
Labels
topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@tim-vandecasteele@CLAassistant@per1234@andreagilardoni

[8]ページ先頭

©2009-2025 Movatter.jp