Changeset 322 for py-tcpmultiplexer


Ignore:
Timestamp:
Jul 19, 2011, 9:48:37 PM (13 years ago)
Author:
Rick van der Zwet
Message:

VLC webcam stream

Location:
py-tcpmultiplexer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • py-tcpmultiplexer/TCPMultiplexer.py

    r320 r322  
    6666          if urlid == '/':
    6767            self.request.send("HTTP/1.1 200 OK\n\n<html><head><title>Overview</title></head><body><h3>Streams</h3><ul>")
    68             for urlid in urldata.keys():
     68            for urlid in sorted(urldata.keys()):
    6969              self.request.send('<li><a href="%(urlid)s">%(urlid)s</a></li>' % {'urlid': urlid})
    7070            self.request.send("</ul><h3>Files</h3><ul>")
     
    7373              [dirs.remove(name) for name in dirs if name.startswith('.')]
    7474              [files.remove(name) for name in files if name.startswith('.')]
    75               for name in files:
     75              for name in sorted(files):
    7676                self.request.send('<li><a href="%(item)s">%(item)s</li>' % { 'item' : os.path.join(root.replace(document_root,'',1),name) })
    7777            self.request.send("</ul></body></html>")
     
    9292            self.request.send("HTTP/1.1 404 NOT FOUND\nContent-Type: text/html\n\n<h1>404</h1>The page '%s' does not exists" % urlid)
    9393        except IOError:
    94           pass
    95         except StandardError, e:
    96           logging.warning('Server has issues: %s', e)
     94          logging.info("Connection closed from '%s'", self.client_address[0])
    9795          del urldata[urlid][self]
    9896
     
    129127        headers = []
    130128        for header in data.splitlines():
    131           if not header.strip(): break
     129          if not header.strip():
     130            # Newlines in the beginning are evil
     131            if headers:
     132              break
     133            else:
     134              continue
    132135          headers.append(header)
    133136        boundry = headers[0]
  • py-tcpmultiplexer/htdocs/browser.html

    r321 r322  
    3838<input type="radio" name="cam" value="/cam1/video">Cam1</input>
    3939<input type="radio" name="cam" value="/cam2/video">Cam2</input>
    40 <input type="radio" name="cam" value="/cam3/video">Cam2</input>
    41 <input type="radio" name="cam" value="/cam4/video">Cam2</input>
     40<input type="radio" name="cam" value="/cam3/video">Cam3</input>
     41<input type="radio" name="cam" value="/cam4/video">Cam4</input>
     42<input type="radio" name="cam" value="/cam5/video">Cam5</input>
    4243</td></tr>
    4344<tr><td>Select Audio:</td><td>
  • py-tcpmultiplexer/streams.yaml

    r320 r322  
    55'/cam3/video' : 'http://172.16.2.200/stream.jpg'
    66'/cam4/video' : 'http://172.16.2.199/mjpeg'
     7'/cam5/video' : 'http://rvdzwet-MacBookPro.occ2011.org:9000/webcam'
Note: See TracChangeset for help on using the changeset viewer.