Skip to content

Commit

Permalink
Use ArrayBuffer in WS browser dialer binaryType (#3468)
Browse files Browse the repository at this point in the history
On my machine, browserdialer speedtest gives 10 Mbit/s download. Now it
can do 300 Mbit/s.
  • Loading branch information
mmmray committed Jun 22, 2024
1 parent 028a640 commit eb4f942
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions transport/internet/websocket/dialer.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
count += 1
console.log("Prepare", url)
var ws = new WebSocket(url)
// arraybuffer is significantly faster in chrome than default
// blob, tested with chrome 123
ws.binaryType = "arraybuffer";
var wss = undefined
var first = true
ws.onmessage = function (event) {
Expand All @@ -23,6 +26,7 @@
var arr = event.data.split(" ")
console.log("Dial", arr[0], arr[1])
wss = new WebSocket(arr[0], arr[1])
wss.binaryType = "arraybuffer";
var opened = false
wss.onopen = function (event) {
opened = true
Expand Down

0 comments on commit eb4f942

Please # to comment.