mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
spice support for proxy overriding
This commit is contained in:
parent
a07f76f540
commit
e5e204fca0
@ -68,6 +68,7 @@ class SPICETransport(BaseSpiceTransport):
|
||||
autoNewUsbShare = BaseSpiceTransport.autoNewUsbShare
|
||||
smartCardRedirect = BaseSpiceTransport.smartCardRedirect
|
||||
sslConnection = BaseSpiceTransport.SSLConnection
|
||||
overridedProxy = BaseSpiceTransport.overridedProxy
|
||||
|
||||
def getUDSTransportScript(
|
||||
self,
|
||||
@ -99,7 +100,7 @@ class SPICETransport(BaseSpiceTransport):
|
||||
con['cert_subject'],
|
||||
fullscreen=self.fullScreen.isTrue(),
|
||||
)
|
||||
r.proxy = con.get('proxy', None)
|
||||
r.proxy = self.overridedProxy.value.strip() or con.get('proxy', None)
|
||||
|
||||
r.usb_auto_share = self.usbShare.isTrue()
|
||||
r.new_usb_auto_share = self.autoNewUsbShare.isTrue()
|
||||
|
@ -123,11 +123,11 @@ class BaseSpiceTransport(transports.Transport):
|
||||
|
||||
overridedProxy = gui.TextField(
|
||||
order=10,
|
||||
label=_('Proxy'),
|
||||
tooltip=_('If not empty, this proxy will be used to connect to the service'),
|
||||
label=_('Override Proxy'),
|
||||
tooltip=_('If not empty, this proxy will be used to connect to the service instead of the one provided by the hypervisor. Format: http://host:port'),
|
||||
required=False,
|
||||
tab=gui.Tab.ADVANCED,
|
||||
pattern=''
|
||||
pattern=gui.TextField.PatternTypes.URL,
|
||||
)
|
||||
|
||||
def isAvailableFor(self, userService: 'models.UserService', ip: str) -> bool:
|
||||
|
@ -103,6 +103,7 @@ class TSPICETransport(BaseSpiceTransport):
|
||||
autoNewUsbShare = BaseSpiceTransport.autoNewUsbShare
|
||||
smartCardRedirect = BaseSpiceTransport.smartCardRedirect
|
||||
sslConnection = BaseSpiceTransport.SSLConnection
|
||||
overridedProxy = BaseSpiceTransport.overridedProxy
|
||||
|
||||
def initialize(self, values: 'Module.ValuesType'):
|
||||
if values:
|
||||
@ -153,6 +154,7 @@ class TSPICETransport(BaseSpiceTransport):
|
||||
fullscreen=self.fullScreen.isTrue(),
|
||||
)
|
||||
else:
|
||||
con['proxy'] = self.overridedProxy.value.strip() or con['proxy']
|
||||
# extract host and port from proxy url
|
||||
host, port = con['proxy'].split('://')[1].split(':')[0:2]
|
||||
ticket = TicketStore.create_for_tunnel(
|
||||
|
Loading…
Reference in New Issue
Block a user