Changeset 289 for trunk/packages
- Timestamp:
- Mar 28, 2008, 8:31:21 PM (17 years ago)
- Location:
- trunk/packages/sipb-xen-vnc-server/code
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-vnc-server/code/vncexternalauth.py
r288 r289 46 46 47 47 def dataReceived(self,data): 48 #self.socks.log(self,"R"+data)49 48 self.socks.write(data) 50 49 51 50 def write(self,data): 52 #self.socks.log(self,'W'+data)53 51 self.transport.write(data) 54 52 … … 56 54 class VNCAuth(protocol.Protocol): 57 55 58 def __init__(self,logging=None,server="localhost"): 59 self.logging=logging 56 def __init__(self,server="localhost"): 60 57 self.server=server 61 58 self.auth=None … … 176 173 177 174 def write(self,data): 178 #self.log(self,data)179 175 self.transport.write(data) 180 176 181 177 def log(self,proto,data): 182 if not self.logging: return183 178 peer = self.transport.getPeer() 184 179 their_peer = self.otherConn.transport.getPeer() 185 f=open(self.logging,"a") 186 f.write("%s\t%s:%d %s %s:%d\n"%(time.ctime(), 180 print "%s\t%s:%d %s %s:%d\n"%(time.ctime(), 187 181 peer.host,peer.port, 188 182 ((proto==self and '<') or '>'), 189 their_peer.host,their_peer.port) )183 their_peer.host,their_peer.port), 190 184 while data: 191 185 p,data=data[:16],data[16:] 192 f.write(string.join(map(lambda x:'%02X'%ord(x),p),' ')+' ')193 f.write((16-len(p))*3*' ')186 print string.join(map(lambda x:'%02X'%ord(x),p),' ')+' ', 187 print ((16-len(p))*3*' '), 194 188 for c in p: 195 if len(repr(c))>3: f.write('.') 196 else: f.write(c) 197 f.write('\n') 198 f.write('\n') 199 f.close() 189 if len(repr(c))>3: print '.', 190 else: print c, 191 print "" 192 print "" 200 193 201 194 … … 206 199 """ 207 200 208 def __init__(self, log, server): 209 self.logging = log 201 def __init__(self, server): 210 202 self.server = server 211 203 212 204 def buildProtocol(self, addr): 213 return VNCAuth(self. logging, self.server)214 205 return VNCAuth(self.server) 206 -
trunk/packages/sipb-xen-vnc-server/code/vncproxy.py
r288 r289 9 9 10 10 if '__main__' == __name__: 11 reactor.listenSSL(10003,vncexternalauth.VNCAuthFactory("./vncauth.log", "localhost"), contextFactory=sslContext) 12 #reactor.listenTCP(10003,vncexternalauth.VNCAuthFactory("./vncauth.log", "localhost")) 11 reactor.listenSSL(10003,vncexternalauth.VNCAuthFactory("localhost"), contextFactory=sslContext) 13 12 reactor.run()
Note: See TracChangeset
for help on using the changeset viewer.