HTTP Fake

JSON Reference

HTTP-Strip

The server role in a simulated HTTP websocket exchange. A HTTP 1.1 websocket header exchange is used to be able to pass through any HTTP based systems; however, this ongoing raw TCP communication continues thereafter which is not standard HTTP 1.1 websocket operation. websockets are supposed to have framed messages, this implementation has no encapsulation.

No value is required, so use an empty string

Example

"HTTP-Strip":""

Properties

  • Activation Phase = Top down

  • Type = Step

  • Stream Interaction = One Off

  • Network terminating = No

  • JSON Value Type = inline string (empty)

  • Initiator = No

HTTP-Client

The client role in a simulated HTTP websocket exchange.

There is a single inline string value parameter:

  • URL - an address, a : character, and a port. The address can be a DNS hostname, direct IPv4 address, or direct IPv6 address.

Example

"HTTP-Client":"http://hostname.com/relativeURI"

Properties

  • Activation Phase = Bottom Up

  • Type = Step

  • Stream Interaction = One Off

  • Network terminating = No

  • JSON Value Type = inline string

  • Initiator = No

HTTP-ReverseClient

Similar to HTTP-Client but with Top Down phase activation. This is typically used on the remote host side to establish a raw TCP link with a support host. A HTTP 1.1 websocket header exchange is used to be able to pass through any HTTP based systems; however, this ongoing raw TCP communication continues thereafter which is not standard HTTP 1.1 websocket operation. Websockets are supposed to have framed messages, this implementation has no encapsulation.

There is a single inline string value parameter:

  • TCP Endpoint - an address, a : character, and a port. The address can be a DNS hostname, direct IPv4 address, or direct IPv6 address.

Example

"HTTP-ReverseClient":"http://hostname.com/relativeURI"

Properties

  • Activation Phase = Top Down

  • Type = Step

  • Stream Interaction = One Off

  • Network terminating = No

  • JSON Value Type = inline string

  • Initiator = No

Implementation

Warning: The duct connection won't work if the response message from the HTTP-Server is changed in any way. The client side is expecting an exact response.

The client sends the following header

GET {0} HTTP/1.1\r\n
Host: {1}\r\n
Transfer-Encoding: chunked\r\n
Upgrade: websocket\r\n
Connection: Upgrade\r\n
\r\n

Where {0} is the relative URI, and {1} is the Host that would normally be part of an absolute URI.

The server side responds with the following exactly

HTTP/1.1 101 Switching Protocols\r\n
Upgrade: websocket\r\n
Connection: Upgrade\r\n
\r\n