File tree Expand file tree Collapse file tree 5 files changed +24
-130
lines changed 
usr/local/lib/web/backend/vnc Expand file tree Collapse file tree 5 files changed +24
-130
lines changed   Load Diff This file was deleted. 
Original file line number Diff line number Diff line change 1+ Dockerfile.amd64
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ Troubleshooting and FAQ
1461463 .  Autostart, https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/85 
1471474 .  x11vnc arguments(multiptr), https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/101 
1481485 .  firefox/chrome crash (/dev/shm), https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/112 
149+ 6 .  resize display size without destroying container, https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/115#issuecomment-522426037 
149150
150151License
151152================== 
Original file line number Diff line number Diff line change @@ -13,12 +13,21 @@ server {
1313root /usr/local/lib/web/frontend/;
1414index index.html index.htm;
1515
16- location /api/ {
16+ location ~  /api/ {
1717try_files $uri @api;
1818}
1919
20+ location ~ /resize$ {
21+ try_files $uri @api;
22+ }
23+ 
24+ #_RELATIVE_URL_ROOT_location /_RELATIVE_URL_ROOT_/ {
25+ #_RELATIVE_URL_ROOT_	rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break;
26+ #_RELATIVE_URL_ROOT_	root /usr/local/lib/web/frontend/;
27+ #_RELATIVE_URL_ROOT_}
28+ 
2029location ~ /websockify$ {
21- #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 last ;
30+ #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break ;
2231proxy_http_version 1.1;
2332proxy_set_header Upgrade $http_upgrade;
2433proxy_set_header Connection "upgrade";
@@ -30,17 +39,12 @@ server {
3039}
3140
3241location @api {
33- #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 last ;
42+ #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break ;
3443proxy_set_header X-Real-IP $remote_addr;
3544proxy_set_header X-Forwarded-For $remote_addr;
3645proxy_set_header Host $host;
3746proxy_pass http://127.0.0.1:6079;
3847max_ranges 0;
3948}
40- 
41- #_RELATIVE_URL_ROOT_location /_RELATIVE_URL_ROOT_/ {
42- #_RELATIVE_URL_ROOT_	rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 last;
43- #_RELATIVE_URL_ROOT_	root /usr/local/lib/web/frontend/;
44- #_RELATIVE_URL_ROOT_}
4549}
4650
Original file line number Diff line number Diff line change 99 Response ,
1010 jsonify ,
1111 abort ,
12-  url_for ,
1312)
1413from  gevent  import  subprocess  as  gsp , spawn , sleep 
1514from  geventwebsocket .exceptions  import  WebSocketError 
2827@app .route ('/api/state' ) 
2928@httperror  
3029def  apistate ():
31-  print (url_for ("apistate" ))
3230 state .wait (int (request .args .get ('id' , - 1 )), 30 )
3331 state .switch_video (request .args .get ('video' , 'false' ) ==  'true' )
3432 mystate  =  state .to_dict ()
@@ -40,7 +38,6 @@ def apistate():
4038
4139@app .route ('/api/health' ) 
4240def  apihealth ():
43-  print (url_for ("apihealth" ))
4441 if  state .health :
4542 return  'success' 
4643 abort (503 , 'unhealthy' )
@@ -71,6 +68,13 @@ def reset():
7168 return  jsonify ({'code' : 200 })
7269
7370
71+ @app .route ('/resize' ) 
72+ @httperror  
73+ def  apiresize ():
74+  state .reset_size ()
75+  return  '<html><head><script type = "text/javascript">var h=window.location.href;window.location.href=h.substring(0,h.length-6);</script></head></html>' 
76+ 
77+ 
7478@app .route ('/api/live.flv' ) 
7579@httperror  
7680def  liveflv ():
Original file line number Diff line number Diff line change @@ -113,6 +113,9 @@ def _update_size(self):
113113 except  gsp .CalledProcessError  as  e :
114114 log .warn ('failed to get dispaly size: '  +  str (e ))
115115
116+  def  reset_size (self ):
117+  self .size_changed_count  =  0 
118+ 
116119 @property  
117120 def  w (self ):
118121 return  self ._w 
                                 You can’t perform that action at this time. 
               
                  
0 commit comments