Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Proxy -> Bridge

  • Loading branch information...
commit dfe88e3316e74d6ceac4233f6ac3d4e213bf23a9 1 parent 7e5f2e0
Andrea Luzzardi authored
Showing with 13 additions and 13 deletions.
  1. +4 −4 bin/wsshd
  2. +1 −1  wssh/__init__.py
  3. +8 −8 wssh/server.py
8 bin/wsshd
View
@@ -32,9 +32,9 @@ def connect(hostname, username):
app.logger.error('Abort: Request is not WebSocket upgradable')
raise BadRequest()
- proxy = wssh.WSSHProxy(request.environ['wsgi.websocket'])
+ bridge = wssh.WSSHBridge(request.environ['wsgi.websocket'])
try:
- proxy.open(
+ bridge.open(
hostnam3e=hostname,
username=username,
password=request.args.get('password'),
@@ -47,9 +47,9 @@ def connect(hostname, username):
request.environ['wsgi.websocket'].close()
return str()
if 'run' in request.args:
- proxy.execute(request.args)
+ bridge.execute(request.args)
else:
- proxy.shell()
+ bridge.shell()
# We have to manually close the websocket and return an empty response,
# otherwise flask will complain about not returning a response and will
2  wssh/__init__.py
View
@@ -1,3 +1,3 @@
-from server import WSSHProxy
+from server import WSSHBridge
__version__ = '0.1.0'
16 wssh/server.py
View
@@ -27,11 +27,11 @@
from StringIO import StringIO
-class WSSHProxy(object):
- """ WebSocket to SSH Proxy Server """
+class WSSHBridge(object):
+ """ WebSocket to SSH Bridge Server """
def __init__(self, websocket):
- """ Initialize a WSSH Proxy
+ """ Initialize a WSSH Bridge
The websocket must be the one created by gevent-websocket
"""
@@ -134,8 +134,8 @@ def _forward_outbound(self, channel):
finally:
self.close()
- def _proxy(self, channel):
- """ Full-duplex proxy between a websocket and a SSH channel """
+ def _bridge(self, channel):
+ """ Full-duplex bridge between a websocket and a SSH channel """
channel.setblocking(False)
channel.settimeout(0.0)
self._tasks = [
@@ -145,7 +145,7 @@ def _proxy(self, channel):
gevent.joinall(self._tasks)
def close(self):
- """ Terminate a proxy session """
+ """ Terminate a bridge session """
gevent.killall(self._tasks, block=True)
self._tasks = []
self._ssh.close()
@@ -163,7 +163,7 @@ def execute(self, command, term='xterm'):
channel = transport.open_session()
channel.get_pty(term)
channel.exec_command(command)
- self._proxy(channel)
+ self._bridge(channel)
channel.close()
def shell(self, term='xterm'):
@@ -176,5 +176,5 @@ def shell(self, term='xterm'):
prior to starting the session.
"""
channel = self._ssh.invoke_shell(term)
- self._proxy(channel)
+ self._bridge(channel)
channel.close()
Please sign in to comment.
Something went wrong with that request. Please try again.