mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-07-28 05:18:35 +00:00
feat: add padding to requests & responses
This commit is contained in:
@@ -9,8 +9,9 @@ const (
|
||||
URLHost = "hysteria"
|
||||
URLPath = "/auth"
|
||||
|
||||
HeaderAuth = "Hysteria-Auth"
|
||||
HeaderCCRX = "Hysteria-CC-RX"
|
||||
HeaderAuth = "Hysteria-Auth"
|
||||
HeaderCCRX = "Hysteria-CC-RX"
|
||||
HeaderPadding = "Hysteria-Padding"
|
||||
|
||||
StatusAuthOK = 233
|
||||
)
|
||||
@@ -24,6 +25,7 @@ func AuthRequestDataFromHeader(h http.Header) (auth string, rx uint64) {
|
||||
func AuthRequestDataToHeader(h http.Header, auth string, rx uint64) {
|
||||
h.Set(HeaderAuth, auth)
|
||||
h.Set(HeaderCCRX, strconv.FormatUint(rx, 10))
|
||||
h.Set(HeaderPadding, authRequestPadding.String())
|
||||
}
|
||||
|
||||
func AuthResponseDataFromHeader(h http.Header) (rx uint64) {
|
||||
@@ -33,4 +35,5 @@ func AuthResponseDataFromHeader(h http.Header) (rx uint64) {
|
||||
|
||||
func AuthResponseDataToHeader(h http.Header, rx uint64) {
|
||||
h.Set(HeaderCCRX, strconv.FormatUint(rx, 10))
|
||||
h.Set(HeaderPadding, authResponsePadding.String())
|
||||
}
|
||||
|
Reference in New Issue
Block a user