File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,15 +234,21 @@ function changeWisp(value) {
234234}
235235
236236function transportChange ( value ) {
237- if ( value === 'soon' ) {
238- return ;
237+ function epoxy ( ) {
238+ localStorage . setItem ( 'transports' , 'epoxy' ) ;
239+ setTransports ( 'epoxy' ) ;
240+ }
241+ function defaultFUNC ( ) {
242+ localStorage . setItem ( 'transports' , 'libcurl' ) ;
243+ setTransports ( 'libcurl' ) ;
244+ setItems ( ) ;
239245 }
240246 if ( value === 'epoxy' ) {
241- notifyBeta ( 'Epoxy' , setEpoxyTransport , setTransports ) ;
247+ notifyBeta ( 'Epoxy' , epoxy , defaultFUNC ) ;
242248 }
243249 else {
244250 localStorage . setItem ( 'transports' , value ) ;
245- setTransports ( ) ;
251+ setTransports ( value ) ;
246252 }
247253}
248254
Original file line number Diff line number Diff line change 1- const transports = localStorage . getItem ( 'transports' ) ;
21const wispUrl = localStorage . getItem ( 'wispUrl' ) || ( location . protocol === "https:" ? "wss" : "ws" ) + "://" + location . host + "/wisp/" ;
32
4- function setTransports ( ) {
5- switch ( transports ) {
3+ function setTransports ( transport ) {
4+ function localStorageTransport ( ) {
5+ switch ( localStorage . getItem ( 'transports' ) ) {
6+ case 'libcurl' :
7+ setLibcurlTransport ( ) ;
8+ break ;
9+ case 'epoxy' :
10+ setEpoxyTransport ( ) ;
11+ break ;
12+ default :
13+ setLibcurlTransport ( ) ;
14+ break ;
15+ }
16+ }
17+ switch ( transport ) {
618 case 'libcurl' :
719 setLibcurlTransport ( ) ;
820 break ;
921 case 'epoxy' :
1022 setEpoxyTransport ( ) ;
1123 break ;
1224 default :
13- setEpoxyTransport ( ) ;
25+ localStorageTransport ( ) ;
1426 break ;
1527 }
1628}
@@ -20,8 +32,16 @@ function setLibcurlTransport() {
2032 BareMux . SetTransport ( 'CurlMod.LibcurlClient' , { wisp : localStorage . getItem ( 'wispUrl' ) || wispUrl , wasm : '/libcurl.wasm' } )
2133}
2234
35+ function destroyLibcurlTransport ( ) {
36+ //remove all wasm modules
37+
38+ for ( let i = 0 ; i < WebAssembly . Module . length ; i ++ ) {
39+ WebAssembly . Module [ i ] . dispose ( ) ;
40+ }
41+ }
42+
2343function setDefaultTransport ( ) {
24- if ( ! transports ) {
44+ if ( ! localStorage . getItem ( ' transports' ) ) {
2545 localStorage . setItem ( 'transports' , 'libcurl' ) ;
2646 setLibcurlTransport ( ) ;
2747 }
Original file line number Diff line number Diff line change 3838 < div id ="tile ">
3939 < h2 > Proxy </ h2 >
4040 < select id ="proxySelect " class ="select " onchange ="proxyChange(this.value) ">
41- < option value ="uv "> UltraViolet </ option >
41+ < option value ="uv "> Ultraviolet </ option >
4242 <!-- option value="dynamic"> Dynamic (Beta) </option -->
4343 < option value ="rammerhead "> Rammerhead </ option >
4444 </ select >
You can’t perform that action at this time.
0 commit comments