[winswitch] XPRA/HTML5

Mukul Agrawal mukulagrawal78 at yahoo.com
Wed May 4 17:43:57 BST 2016


Started xpra server using :-sudo xpra start --bind-tcp=0.0.0.0:80 --html=on --start-child=xterm


xpra stop does not work but xpra stop tcp:0.0.0.0:80 did work. 
See details below.
Thanks!

---------------
Here are the details.I am using  Ubuntu 14.04.3 LTS and xpra v0.15.10.

Started xpra server using :-sudo xpra start --bind-tcp=0.0.0.0:80 --html=on --start-child=xtermMessage on terminal shows :-
Warning: running as root
 Entering daemon mode; any further errors will be reported to:
  /home/ubuntu/.xpra/S21262.log
Actual log file name is now: /home/ubuntu/.xpra/:0.log
check status with
xpra list 
Message on terminal shows :-
Found the following xpra sessions:
        UNKNOWN session at :0
        UNKNOWN session at :10
Re-probing unknown sessions: :0, :10
        UNKNOWN session at :0 (cleaned up)
        UNKNOWN session at :10 (cleaned up)

check with
 sudo netstat -ntlp | grep LISTEN
Message on terminal shows :-
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      21266/python
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1023/sshd
tcp        0      0 127.0.0.1:37113         0.0.0.0:*               LISTEN      21278/python
tcp6       0      0 :::22                   :::*                    LISTEN      1023/sshd

attempt to stopxpra stopMessage on terminal shows :-xpra initialization error: cannot find a live server to connect to

another attempt to stopsudo xpra stopMessage on terminal shows :-Warning: running as root
xpra initialization error: cannot find a live server to connect to
another attempt to stopsudo xpra stop tcp:0.0.0.0:80

Warning: running as root
cannot use pycups for printing: No module named cups
server requested disconnect: server shutdown
Sent shutdown command

xpra list
xpra initialization error: No xpra sessions found
 Regards, 
Mukul ( https://sites.google.com/site/mukulagrawal ) 

    On Wednesday, May 4, 2016 4:32 AM, Antoine Martin <antoine at nagafix.co.uk> wrote:
 

 On 04/05/16 13:32, Mukul Agrawal wrote:
> OK, thx. This helped a lot.
> 
> A couple more glitches (hopefully last ones!) :-
> 
> 1. When I start xpra server to listen on tcp port through
> sudo xpra start --bind-tcp=0.0.0.0:80 --html=on --start-child=xterm
> 
> I cannot stop it using
> xpra stop
> or even
> sudo xpra stop
> 
> xpra shows buggy looking message
Please include the message, this description of it is not helping.
Also include the exact commands that you used.

> saying no active session was found but
> when I try to restart another session at same display it says display is
> being used. I know for sure it is being sued because my client is still
> connected. Even if I kill the process listening to port 80 I still
> cannot freeup the display already used.
> 
> How do I stop xpra attached to TCP ports?
xpra stop tcp:IP:PORT
Or if you know the display number that was chosen when you started:
xpra stop :DISPLAY
(and use sudo if you run as root..)

> 2. I used sudo because I want xpra server to listen to privileged port
> 80 but I do not want x-cleints to be running in sudo mode. Any ideas for
> a work around? How can applications started from non-priviledged account
> can send their graphics to xpra display connected to tcp port 80 ?
> Any ideas?
There are many ways, this is a very common question so google it.
OTOH, here are a few options:
* iptables port forwarding - the best option
* setcap (not recommended - would need to apply to all python scripts)
* run netcat (as root)
* run an xpra proxy server (as root)

Cheers
Antoine

> Regards,
> Mukul
> 
> 
> On Tuesday, May 3, 2016 7:04 PM, Antoine Martin <antoine at nagafix.co.uk>
> wrote:
> 
> 
> On 03/05/16 18:53, Mukul Agrawal wrote:
>> Thanks!I have Apache webserver running on port 80. I have root access 
> but I need use port 80 for outside traffic for both the webserver and
> the xpra server because seems like firewall is blocking traffic on other
> ports.
>> I tried following :-
>> Editted /etc/apache2/ports.conf to make sure httpd is listening to
> 8080 and not 80.
>>
>> Listen 8080
>> Then started apache :-
>> sudo service apache2 start
>>
>> And then started xpra server on port 80 with "sudo"sudo xpra start
> --bind-tcp=0.0.0.0:80 --html=on --start-child=xterm
>>
>> Will --html=on start a new web server?
> Sort of.
> It will start websockify on demand for handling TCP connections that
> aren't using xpra's protocol, ie: HTTP.
> Websockify also serves static webpages, in particular the xpra HTML5
> client page as the default page.
> 
>> Or will it just start a porxy and point it to httpd listenning on 8080?
>>
>> Otherwise, should I do following (again with "sudo")
>>
>> sudo xpra start :10 --bind-tcp=0.0.0.0:80 --tcp-proxy=127.0.0.1:8080
>> --start-child=xterm
> That's the one you want.
> It will redirect non-xpra traffic (ie: the websockify packet data from
> the HTML5 client) to port 8080 where your apache server is listening.
> 
>> When I point the browser on the client machine on internet to
> http://SERVER-IP <http://server-ip/>should I expect to see index page of
> webserver or the xpra xterm?
> The index page of the webserver.
> In the case of websockify, this page is the xpra HTML5 client page,
> which is why you automatically get connected.
> You can achieve the same thing with apache by dropping that same page
> into the htdocs directory.
> 
>> Last question, what does :10 mean here because seems like we are
> accessing xpra through tcp port 80.
> All applications running through xpra use an X11 display.
> (well, when using the standard xpra X11 seamless server anyway)
> 
> On most distributions, you can omit the display number and one will be
> chosen automatically.
> 
>> So why bother specifying display number? Where do I use :10 in the
> xpra attach command when using html5 client?
> You don't.
> 
> Cheers
> Antoine
> 
>> Thanks in advance! Help greatly appreciated.
>>  Regards, Mukul
>> ( https://sites.google.com/site/mukulagrawal
> <https://sites.google.com/site/mukulagrawal>)
>>
>>    On Tuesday, May 3, 2016 2:01 AM, Antoine Martin
> <antoine at nagafix.co.uk <mailto:antoine at nagafix.co.uk>> wrote:
>> 
>>
>>  Please do not email me directly, use the mailing list.
>>
>> Antoine
>>
>> On 03/05/16 15:49, Mukul Agrawal wrote:
>>> I have an Apache webserver running on port 80. I have root access  but I
>>> have to use port 80 for both webserver and xpra server because seems
>>> like firewall in blocking traffic on other ports.
>>>
>>> Should I use this to start xpra server?
>>>
>>> sudo xpra start :10 --bind-tcp=80 --start-child=xterm
> --tcp-proxy=127.0.0.1:80
>>>
>>>
>>> Another question, what does :10 mean here because seems like we are
>>> accessing xpra through tcp port 80. So why bother specifying display
>>> number? Do I or can I use :10 in the xpra attach command?
>>>
>>> Sent from Yahoo Mail on Android
>>> <https://overview.mail.yahoo.com/mobile/?.src=Android>
>>>
>>>    On Mon, May 2, 2016 at 9:47 PM, Antoine Martin
>>>    <antoine at nagafix.co.uk <mailto:antoine at nagafix.co.uk>> wrote:
>>>
>>>    On 03/05/16 04:59, Mukul Agrawal wrote:
>>>    > I am accessing a remote Ubuntu machine from a local MS Win7 machine.
>>>    > I am trying to use the HTML5 client from browser. On Ubuntu
>>>    machine I only have ports 22, 80 and 443 open.Can somebody suggest
>>>    what exact command should I use to start the xpra server on ubuntu
>>>    machine?I am guessing that I will need to use the port 80 for both
>>>    xpra server as well as for http.
>>>    > Is this possible? How do I do that?
>>>    http://xpra.org/trac/wiki/Clients/HTML5
>>>    It uses port 10000 for everything in this example, but you can use
>>>    almost any port you like: ports below 1024 require root, so you're
>>>    probably better off using a higher port or using iptables to
> redirect to
>>>    a non-privileged port.
>>>
>>>    > I don't mind using secure-shell to manually log into the Ubuntu
>>>    machine and then start the xpra-server with proper command to bind
>>>    to proper websocket on the Ubuntu. In fact I will like to do that
>>>    just to make sure I understand how this thing is working.
>>>    > But eventually, it will be preferable if I could do that from
>>>    web-browser on client machine itself and there is no need to logging
>>>    into the Ubuntu machine separately to start the xpra-server.
>>>    Starting xpra from a web browser will require some kind of web
> server to
>>>    connect to in the first place.
>>>    If xpra isn't started yet, you will need to use some other tool for
>>>    that. Perhaps an apache cgi script?
>>>
>>>    > [BTW, I can use xpra with ssh and MSwindows client software just
>>>    fine. It works beautifully! ]
>>>    :)
>>>
>>>    Antoine
>>>
>>>
>>>    > Regards, Mukul
>>>    > ( https://sites.google.com/site/mukulagrawal
>>>    )
>>>
>>>    _______________________________________________
>>>    shifter-users mailing list
>>>    shifter-users at lists.devloop.org.uk
> <mailto:shifter-users at lists.devloop.org.uk> <javascript:return>
>>>    http://lists.devloop.org.uk/mailman/listinfo/shifter-users
>>>
>>
>>
>>
>> 
>> _______________________________________________
>> shifter-users mailing list
>> shifter-users at lists.devloop.org.uk
> <mailto:shifter-users at lists.devloop.org.uk>
>> http://lists.devloop.org.uk/mailman/listinfo/shifter-users
> 
>>
> 
> _______________________________________________
> shifter-users mailing list
> shifter-users at lists.devloop.org.uk
> <mailto:shifter-users at lists.devloop.org.uk>
> http://lists.devloop.org.uk/mailman/listinfo/shifter-users
> 
> 



  


More information about the shifter-users mailing list