mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-07-20 09:35:55 +02:00
Fix caps settings
Force Bandwidth (should make configurable)
This commit is contained in:
parent
e714881e59
commit
27d36f83f2
3 changed files with 22 additions and 9 deletions
|
@ -171,5 +171,8 @@ func (c *Config) HandleDownload(w http.ResponseWriter, r *http.Request) {
|
||||||
"gatewaycredentialssource:i:5\r\n"+
|
"gatewaycredentialssource:i:5\r\n"+
|
||||||
"gatewayusagemethod:i:1\r\n"+
|
"gatewayusagemethod:i:1\r\n"+
|
||||||
"gatewayprofileusagemethod:i:1\r\n"+
|
"gatewayprofileusagemethod:i:1\r\n"+
|
||||||
"gatewayaccesstoken:s:"+token+"\r\n"))
|
"gatewayaccesstoken:s:"+token+"\r\n"+
|
||||||
|
"networkautodetect:i:0\r\n"+
|
||||||
|
"bandwidthautodetect:i:1\r\n"+
|
||||||
|
"connection type:i:6\r\n"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,8 @@ func NewHandler(s *SessionInfo, conf *HandlerConf) *Handler {
|
||||||
return h
|
return h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tunnelId = 10
|
||||||
|
|
||||||
func (h *Handler) Process() error {
|
func (h *Handler) Process() error {
|
||||||
for {
|
for {
|
||||||
pt, sz, pkt, err := h.ReadMessage()
|
pt, sz, pkt, err := h.ReadMessage()
|
||||||
|
@ -295,9 +297,9 @@ func createTunnelResponse() []byte {
|
||||||
binary.Write(buf, binary.LittleEndian, uint16(0)) // reserved
|
binary.Write(buf, binary.LittleEndian, uint16(0)) // reserved
|
||||||
|
|
||||||
// tunnel id (when is it used?)
|
// tunnel id (when is it used?)
|
||||||
binary.Write(buf, binary.LittleEndian, uint32(10))
|
binary.Write(buf, binary.LittleEndian, uint32(tunnelId))
|
||||||
// caps, w2019 sends 63 -> windows client requests 63
|
|
||||||
binary.Write(buf, binary.LittleEndian, uint32(63))
|
binary.Write(buf, binary.LittleEndian, uint32(HTTP_CAPABILITY_IDLE_TIMEOUT))
|
||||||
|
|
||||||
return createPacket(PKT_TYPE_TUNNEL_RESPONSE, buf.Bytes())
|
return createPacket(PKT_TYPE_TUNNEL_RESPONSE, buf.Bytes())
|
||||||
}
|
}
|
||||||
|
@ -357,10 +359,9 @@ func readChannelCreateRequest(data []byte) (server string, port uint16) {
|
||||||
func createChannelCreateResponse() []byte {
|
func createChannelCreateResponse() []byte {
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
|
|
||||||
binary.Write(buf, binary.LittleEndian, uint32(0)) // error code
|
binary.Write(buf, binary.LittleEndian, uint32(0)) // error code
|
||||||
//binary.Write(buf, binary.LittleEndian, uint16(HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID | HTTP_CHANNEL_RESPONSE_FIELD_AUTHNCOOKIE | HTTP_CHANNEL_RESPONSE_FIELD_UDPPORT)) // fields present
|
binary.Write(buf, binary.LittleEndian, uint16(HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID)) // fields present
|
||||||
binary.Write(buf, binary.LittleEndian, uint16(HTTP_CHANNEL_RESPONSE_FIELD_CHANNELID))
|
binary.Write(buf, binary.LittleEndian, uint16(0)) // reserved
|
||||||
binary.Write(buf, binary.LittleEndian, uint16(0)) // reserved
|
|
||||||
|
|
||||||
// channel id is required for Windows clients
|
// channel id is required for Windows clients
|
||||||
binary.Write(buf, binary.LittleEndian, uint32(1)) // channel id
|
binary.Write(buf, binary.LittleEndian, uint32(1)) // channel id
|
||||||
|
|
|
@ -65,5 +65,14 @@ const (
|
||||||
SERVER_STATE_TUNNEL_AUTHORIZE = 0x3
|
SERVER_STATE_TUNNEL_AUTHORIZE = 0x3
|
||||||
SERVER_STATE_CHANNEL_CREATE = 0x4
|
SERVER_STATE_CHANNEL_CREATE = 0x4
|
||||||
SERVER_STATE_OPENED = 0x5
|
SERVER_STATE_OPENED = 0x5
|
||||||
SERVER_STATE_CLOSED = 0x6
|
SERVER_STATE_CLOSED = 0x6
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
HTTP_CAPABILITY_TYPE_QUAR_SOH = 0x1
|
||||||
|
HTTP_CAPABILITY_IDLE_TIMEOUT = 0x2
|
||||||
|
HTTP_CAPABILITY_MESSAGING_CONSENT_SIGN = 0x4
|
||||||
|
HTTP_CAPABILITY_MESSAGING_SERVICE_MSG = 0x8
|
||||||
|
HTTP_CAPABILITY_REAUTH = 0x10
|
||||||
|
HTTP_CAPABILITY_UDP_TRANSPORT = 0x20
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue