add ws headers host
This commit is contained in:
@@ -7,6 +7,15 @@
|
|||||||
v-model="transport.path">
|
v-model="transport.path">
|
||||||
</v-text-field>
|
</v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-col cols="12" sm="6" md="4">
|
||||||
|
<v-text-field
|
||||||
|
:label="$t('transport.host')"
|
||||||
|
hide-details
|
||||||
|
v-model="host">
|
||||||
|
</v-text-field>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row>
|
||||||
<v-col cols="12" sm="6" md="4">
|
<v-col cols="12" sm="6" md="4">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
label="Max Early Data"
|
label="Max Early Data"
|
||||||
@@ -42,10 +51,16 @@ export default {
|
|||||||
get() { return this.WS.max_early_data ? this.WS.max_early_data : '' },
|
get() { return this.WS.max_early_data ? this.WS.max_early_data : '' },
|
||||||
set(newValue:number) { this.$props.transport.max_early_data = newValue != 0 ? newValue : undefined }
|
set(newValue:number) { this.$props.transport.max_early_data = newValue != 0 ? newValue : undefined }
|
||||||
},
|
},
|
||||||
|
host: {
|
||||||
|
get() { return this.WS.headers?.Host ? this.WS.headers.Host : '' },
|
||||||
|
set(newValue:string) {
|
||||||
|
this.$props.transport.headers = newValue != "" ? { Host: newValue } : undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.WS.early_data_header_name = 'Sec-WebSocket-Protocol'
|
this.WS.early_data_header_name ??= 'Sec-WebSocket-Protocol'
|
||||||
this.WS.path = '/'
|
this.WS.path ??= '/'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -150,6 +150,7 @@ export namespace LinkUtil {
|
|||||||
case TrspTypes.WebSocket:
|
case TrspTypes.WebSocket:
|
||||||
const tw = <WebSocket>t
|
const tw = <WebSocket>t
|
||||||
params.path = tw.path?? null
|
params.path = tw.path?? null
|
||||||
|
params.host = tw.headers?.Host?? null
|
||||||
break
|
break
|
||||||
case TrspTypes.gRPC:
|
case TrspTypes.gRPC:
|
||||||
const tg = <gRPC>t
|
const tg = <gRPC>t
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ export interface HTTP extends TransportBasics {
|
|||||||
|
|
||||||
export interface WebSocket extends TransportBasics {
|
export interface WebSocket extends TransportBasics {
|
||||||
path: string
|
path: string
|
||||||
headers?: {}
|
headers?: {
|
||||||
|
Host: string
|
||||||
|
}
|
||||||
max_early_data?: number
|
max_early_data?: number
|
||||||
early_data_header_name?: string
|
early_data_header_name?: string
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user