Skip to content

eahrend/gcp-iap-tunnel-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcp-iap-tunnel-parser

Reverse engineering the IAP tunnel to WSS util

Huge shout out to https://github.com/GoogleCloudPlatform/iap-desktop for dealing with the en/decoding of messages.

The out of order message could be coming from the fact that I don't test -> wait -> connect local -> connect socket

  def Run(self):
    """Start accepting connections."""
    if self._should_test_connection:
      try:
        self._TestConnection()
      except iap_tunnel_websocket.ConnectionCreationError as e:
        raise iap_tunnel_websocket.ConnectionCreationError(
            'While checking if a connection can be made: %s' % six.text_type(e))
    self._server_sockets = _OpenLocalTcpSockets(self._local_host,
                                                self._local_port)
    log.out.Print('Listening on port [%d].' % self._local_port)

    try:
      with execution_utils.RaisesKeyboardInterrupt():
        while True:
          self._connections.append(self._AcceptNewConnection())
          # To fix b/189195317, we will need to erase the reference of dead
          # tasks.
          self._CleanDeadClientConnections()
    except KeyboardInterrupt:
      log.info('Keyboard interrupt received.')
    finally:
      self._CloseServerSockets()

    self._shutdown = True
    self._CloseClientConnections()
    log.status.Print('Server shutdown complete.')

About

Reverse engineering the IAP tunnel to WSS util

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages