Class OutboundHandshake

java.lang.Object
org.red5.server.net.rtmp.RTMPHandshake
org.red5.client.net.rtmp.OutboundHandshake
All Implemented Interfaces:
IHandshake

public class OutboundHandshake extends RTMPHandshake
Performs handshaking for client connections.
Author:
Paul Gregoire
  • Constructor Details

    • OutboundHandshake

      public OutboundHandshake()
    • OutboundHandshake

      public OutboundHandshake(byte handshakeType)
    • OutboundHandshake

      public OutboundHandshake(byte handshakeType, int algorithm)
  • Method Details

    • doHandshake

      public org.apache.mina.core.buffer.IoBuffer doHandshake(org.apache.mina.core.buffer.IoBuffer input)
    • createHandshakeBytes

      protected void createHandshakeBytes()
      Creates the servers handshake bytes
      Specified by:
      createHandshakeBytes in class RTMPHandshake
    • generateClientRequest1

      public org.apache.mina.core.buffer.IoBuffer generateClientRequest1()
      Create the first part of the outgoing connection request (C0 and C1).
       C0 = 0x03 (client handshake type - 0x03, 0x06, 0x08, or 0x09)
       C1 = 1536 bytes from the client
       
      Returns:
      outgoing handshake C0+C1
    • decodeServerResponse1

      public org.apache.mina.core.buffer.IoBuffer decodeServerResponse1(org.apache.mina.core.buffer.IoBuffer in)
      Decodes the first server response (S1) and returns a client response (C2).
       S1 = 1536 bytes from the server
       C2 = Copy of S1 bytes
       
      Parameters:
      in - incoming handshake S1
      Returns:
      client response C2
    • decodeServerResponse2

      public boolean decodeServerResponse2(org.apache.mina.core.buffer.IoBuffer buf)
      Decodes the second server response (S2).
       S2 = Copy of C1 bytes
       
      Parameters:
      in - incoming handshake S2
      Returns:
      true if validation passes and false otherwise
    • decodeServerResponse2

      public boolean decodeServerResponse2(byte[] s2)
      Decodes the second server response (S2).
       S2 = Copy of C1 bytes
       
      Parameters:
      in - incoming handshake S2
      Returns:
      true if validation passes and false otherwise
    • validate

      public boolean validate(byte[] handshake)
      Determines the validation scheme for given input.
      Specified by:
      validate in interface IHandshake
      Specified by:
      validate in class RTMPHandshake
      Parameters:
      handshake - the handshake bytes from the server
      Returns:
      true if server used a supported validation scheme, false if unsupported
    • initSwfVerification

      public void initSwfVerification(String swfFilePath)
      Initialize SWF verification data.
      Parameters:
      swfFilePath - path to the swf file or null
    • getHandshakeBytes

      public byte[] getHandshakeBytes()
    • setForceVerification

      public void setForceVerification(boolean forceVerification)