braid-http
Advanced tools
Comparing version 1.3.32 to 1.3.33
@@ -851,3 +851,3 @@ // var peer = Math.random().toString(36).substr(2) | ||
var mux_error = null | ||
var using_multiplex_header = false | ||
var using_multiplex_well_known_url = false | ||
@@ -857,3 +857,3 @@ var mux_promise = (async () => { | ||
try { | ||
if (params.use_multiplex_header) throw 'skip to trying header' | ||
if (params.use_multiplex_well_known_url) throw 'skip to trying header' | ||
var r = await braid_fetch(`${origin}/${multiplexer}`, {method: 'MULTIPLEX', headers: {'Multiplex-Version': '0.0.1'}, retry: true}) | ||
@@ -865,3 +865,3 @@ if (!r.ok || r.headers.get('Multiplex-Version') !== '0.0.1') throw 'bad' | ||
try { | ||
using_multiplex_header = true | ||
using_multiplex_well_known_url = true | ||
r = await braid_fetch(`${origin}/.well-known/multiplex/${multiplexer}`, {headers: {'Multiplex-Version': '0.0.1'}, retry: true}) | ||
@@ -943,4 +943,4 @@ | ||
try { | ||
var r = await braid_fetch(!using_multiplex_header ? `${origin}${params.headers.get('multiplexer')}` : `${origin}/.well-known/multiplex${params.headers.get('multiplexer')}`, { | ||
...!using_multiplex_header && {method: 'MULTIPLEX'}, | ||
var r = await braid_fetch(!using_multiplex_well_known_url ? `${origin}${params.headers.get('multiplexer')}` : `${origin}/.well-known/multiplex${params.headers.get('multiplexer')}`, { | ||
...!using_multiplex_well_known_url && {method: 'MULTIPLEX'}, | ||
headers: { 'Multiplex-Version': '0.0.1' }, retry: true | ||
@@ -947,0 +947,0 @@ }) |
{ | ||
"name": "braid-http", | ||
"version": "1.3.32", | ||
"version": "1.3.33", | ||
"description": "An implementation of Braid-HTTP for Node.js and Browsers", | ||
@@ -5,0 +5,0 @@ "scripts": { |
82107