Comments (5)
I ran into this issue as well. The server I was communicating with was closing the websocket connection due to an invalid frame being sent. It looks like encode-coding-string
causes issues if used in websocket-mask
that are dependent on the specific byte pattern used for the masking.
Here is a test case that will always fail when encode-coding-string
is used in websocket-mask
(cl-letf ((text "{\"parent_header\":{},\"header\":{\"msg_id\":\"a2940bc8-619e-4872-97bd-4c8d6fb93017\",\"msg_type\":\"history_request\",\"version\":\"5.3\",\"username\":\"n\",\"session\":\"409cf442-74ba-462f-8183-6652503005af\",\"date\":\"2019-06-20T02:17:43.925049-0500\"},\"content\":{\"output\":false,\"raw\":false,\"hist_access_type\":\"tail\",\"n\":100},\"metadata\":{},\"buffers\":[],\"channel\":\"shell\"}")
((symbol-function #'websocket-genbytes)
(lambda (&rest _) "\10\206\356\224")))
(let ((frame (websocket-read-frame
(websocket-encode-frame
(make-websocket-frame :opcode 'text
:payload (encode-coding-string text 'raw-text)
:completep t)
t))))
(should frame)
(should (equal (websocket-frame-payload frame) text))))
from emacs-websocket.
I'll see if I can reproduce. None of the commits recently look like they should effect connections at all, although maybe the recent change in error handling behavior caused some hidden problem to surface. Anyway, if I can reproduce it, I'll fix it.
from emacs-websocket.
According to @dickmao, #59 fixes this issue, which I've merged into head.
Can you confirm this fixes the issue? If so, I'll rev. the version to 1.11.1
.
from emacs-websocket.
I've also made an addition small fix beyond the basic fix @dickmao provided in 37ef222. However, I was never able to reproduce this - any clues how I can try to reproduce this sort of thing in a functional test would help me make sure I don't break you again.
from emacs-websocket.
@ahyatt - thanks for the quick response. Yes, I can confirm that EIN is working again. I wish I were smart enough to come up with a good test case, but hopefully the one @dzop provided will serve as check against this happening again.
from emacs-websocket.
Related Issues (20)
- websocket-frame-text error HOT 1
- Add release tags HOT 3
- Custom headers in handshake HOT 4
- How to handle an error occured in `websocket-outer-filter`? HOT 6
- A single message ws.send(data); comes in as two messages HOT 5
- Speed feedback HOT 10
- Error (websocket): in callback `on-message': JSON readtable error HOT 4
- Setting case-fold-search to nil results "Incorrect handhake from websocket" error HOT 7
- declares GPL-3+, but provided full-text license is GPL-2+ HOT 3
- Please tag a 1.12 release HOT 1
- Please consider adapting websocket-functional-test.el to use ert-deftest HOT 12
- TLSv1.3 HOT 1
- Branch rename breaks package installation HOT 6
- websocket-test.el: βfletβ is an obsolete macro (as of [emacs] 24.3) HOT 3
- websocket-to-bytes signal type error HOT 8
- Support connecting through proxies HOT 7
- infinite failure loop - emacs locked up HOT 18
- error 403 with ein over proxy HOT 14
- Push to ELPA? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-websocket.