Module: Rex::Proto::Http::WebSocket::AmazonSsm::Interface

Defined in:
lib/rex/proto/http/web_socket/amazon_ssm.rb

Defined Under Namespace

Modules: SsmChannelMethods Classes: SsmChannel

Instance Method Summary collapse

Instance Method Details

#to_ssm_channel(publish_timeout: 10) ⇒ Object



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/rex/proto/http/web_socket/amazon_ssm.rb', line 209

def to_ssm_channel(publish_timeout: 10)
  chan = SsmChannel.new(self)

  if publish_timeout
    # Waiting for the channel to start publishing
    (publish_timeout * 2).times do
      break if chan.publishing?

      sleep 0.5
    end

    raise Rex::TimeoutError.new('Timed out while waiting for the channel to start publishing.') unless chan.publishing?
  end

  chan
end