Comments (8)
Since we don't include it in the handshake request whatever server you're trying to use isn't implementing the RFC correctly.
See https://datatracker.ietf.org/doc/html/rfc7692
If a received extension negotiation offer doesn't have the
"client_max_window_bits" extension parameter, the corresponding
extension negotiation response to the offer MUST NOT include the
"client_max_window_bits" extension parameter.
The library is correct to error on it.
from websocket.
I did include the client_max_window_bits
parameter because that's what the Chrome browser does. I fixed it in my fork.
from websocket.
related #351
from websocket.
The situation is different from #351.
There the server is hinting us on its window size but that doesn't matter to use as we always use the largest window size. See #258 (comment)
Here if you include client_max_window_bits
you're telling the server it can reply with client_max_window_bits
with a value less than 15. But we don't support that as we cannot adjust the window size to be less than 2**15
.
If a received extension negotiation offer has the
"client_max_window_bits" extension parameter, the server MAY include
the "client_max_window_bits" extension parameter in the corresponding
extension negotiation response to the offer. If the
"client_max_window_bits" extension parameter in a received extension
negotiation offer has a value, the server may either ignore this
value or use this value to avoid allocating an unnecessarily big LZ77
sliding window by including the "client_max_window_bits" extension
parameter in the corresponding extension negotiation response to the
offer with a value equal to or smaller than the received value.
If you know a way to adjust the window size dynamically with the standard library deflate package I'd be happy to add support and then we can support these extensions parameters fully.
from websocket.
In my case the server always reply with client_max_window_bits=15
, I made websocket accept that
switch p {
case "client_no_context_takeover":
copts.clientNoContextTakeover = true
continue
case "server_no_context_takeover":
copts.serverNoContextTakeover = true
continue
case "client_max_window_bits=15":
continue
}
from websocket.
But you just said
I did include the client_max_window_bits parameter because that's what the Chrome browser does. I fixed it in my fork.
If you didn't include it and the server is always replying then the server is broken. It's violating the RFC.
from websocket.
I meant the server replies with client_max_window_bits=15
when the client sends client_max_window_bits
, so it won't break this library
Probably most servers do that
from websocket.
Ok fair enough I'll add a bypass here too.
from websocket.
Related Issues (20)
- websocket.Conn.CloseNow() panics in WaitGroup.Wait HOT 2
- failed to get reader: use of closed network connection HOT 3
- Inline part of the full examples HOT 7
- Add custom ping message option to Ping function HOT 1
- failed to WebSocket dial: response body is not a io.ReadWriteCloser: io.nopCloserWriterTo HOT 1
- Update docs and mention explicit close required change in v1.8.11 HOT 16
- panic: sync: WaitGroup is reused before previous Wait has returned HOT 1
- Return net.ErrClosed from Read methods when connection is closed by us HOT 6
- failed: Close received after close HOT 6
- Document wsjson.Read closes the connection with the appropriate close status and error message if bad JSON is read
- Should use path.Match instead of filepath.Match HOT 4
- Compatibility issues HOT 14
- Improve control on close reason
- Support (*http.ResponseController).Hijack() HOT 1
- Use existing JS Websocket
- Setting authorization headers on handshake request HOT 1
- 1008 unexpected data message: When using htmx client
- WebSocket Dial Handshake 403 When Connecting to Server Written Using x/net/websocket HOT 3
- Upgrading broken due to vanity rename HOT 4
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 websocket.