mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-05 03:38:40 +00:00
Add server support
This commit is contained in:
parent
26199629f7
commit
cab4321956
6 changed files with 87 additions and 40 deletions
|
@ -43,8 +43,13 @@ func executeECH(cmd *base.Command, args []string) {
|
|||
echKeySet, err := goech.GenerateECHKeySet(0, *input_serverName, kem, nil)
|
||||
common.Must(err)
|
||||
|
||||
configBuffer, _ := echKeySet.ECHConfig.MarshalBinary()
|
||||
keyBuffer, _ := echKeySet.MarshalBinary()
|
||||
// Make single key set to a list with only one element
|
||||
ECHConfigList := make(goech.ECHConfigList, 1)
|
||||
ECHConfigList[0] = echKeySet.ECHConfig
|
||||
ECHKeySetList := make(goech.ECHKeySetList, 1)
|
||||
ECHKeySetList[0] = echKeySet
|
||||
configBuffer, _ := ECHConfigList.MarshalBinary()
|
||||
keyBuffer, _ := ECHKeySetList.MarshalBinary()
|
||||
|
||||
configPEM := string(pem.EncodeToMemory(&pem.Block{Type: "ECH CONFIGS", Bytes: configBuffer}))
|
||||
keyPEM := string(pem.EncodeToMemory(&pem.Block{Type: "ECH KEYS", Bytes: keyBuffer}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue