Skip to content

Commit

Permalink
#838: add ability to log all forwarded traffic for debugging purposes
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@9096 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 21, 2015
1 parent 964d1d7 commit 97cb623
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/xpra/server/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
# later version. See the file COPYING for details.

import threading
import binascii
import os

from xpra.log import Logger
log = Logger("proxy")

from xpra.net.bytestreams import untilConcludes

SHOW_DATA = os.environ.get("XPRA_PROXY_SHOW_DATA", "0")=="1"


class XpraProxy(object):
"""
Expand Down Expand Up @@ -54,6 +58,9 @@ def _copy_loop(self, log_name, from_conn, to_conn):
log("%s: connection lost", log_name)
self.quit()
return
if SHOW_DATA:
log("data=%s", buf)
log("data=%s", binascii.hexlify(buf))
while buf and not self._closed:
log("%s: writing %s bytes", log_name, len(buf))
written = untilConcludes(self.is_active, to_conn.write, buf)
Expand Down

0 comments on commit 97cb623

Please sign in to comment.