mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
Update proto file for websocket and httpupgrade (breaking)
This commit is contained in:
parent
53e5814d19
commit
e2302b421c
12 changed files with 121 additions and 194 deletions
|
@ -154,12 +154,9 @@ type WebSocketConfig struct {
|
|||
// Build implements Buildable.
|
||||
func (c *WebSocketConfig) Build() (proto.Message, error) {
|
||||
path := c.Path
|
||||
header := make([]*websocket.Header, 0, 32)
|
||||
header := make(map[string]string);
|
||||
for key, value := range c.Headers {
|
||||
header = append(header, &websocket.Header{
|
||||
Key: key,
|
||||
Value: value,
|
||||
})
|
||||
header[key] = value;
|
||||
}
|
||||
var ed uint32
|
||||
if u, err := url.Parse(path); err == nil {
|
||||
|
|
|
@ -236,11 +236,8 @@ func TestXrayConfig(t *testing.T) {
|
|||
{
|
||||
ProtocolName: "websocket",
|
||||
Settings: serial.ToTypedMessage(&websocket.Config{
|
||||
Header: []*websocket.Header{
|
||||
{
|
||||
Key: "host",
|
||||
Value: "example.domain",
|
||||
},
|
||||
Header: map[string]string{
|
||||
"host": "example.domain",
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
@ -291,11 +288,8 @@ func TestXrayConfig(t *testing.T) {
|
|||
{
|
||||
ProtocolName: "websocket",
|
||||
Settings: serial.ToTypedMessage(&websocket.Config{
|
||||
Header: []*websocket.Header{
|
||||
{
|
||||
Key: "host",
|
||||
Value: "example.domain",
|
||||
},
|
||||
Header: map[string]string{
|
||||
"host": "example.domain",
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue