This is a description of the various variables which can be set via encrypted links.

To learn more about encrypted links, visit this article first: Encrypted Links Introduction

Variables set in the encrypted string will override the corresponding setting from the site configuration. For example, if you set the origin variable to something different in the encrypted string than what is set in the site configuration, the value from the encrypted string will be used.

Encrypted links can be used on Sites, HTTP Live Zones and Real-Time Live Zones. Not all variables are applicable to all types, so they are split into separate lists below

Set only the variables you wish to override, there is no need to set them all.

Note on hot link protection
If you specify the expires variable you can make the link valid for a certain length of time before it expires. If you specify the restrict variable you can make the link valid only for a certain IP address. You can also use both at once.

HTTP-Only Variables

Variables that can be used with Sites and HTTP Live Zones

variable: path
description: Set the path to the file on the origin server
example value: /videos/video1234.flv
notes:
must start with a /

variable: epath
description: Same as path but allows for a URL encoded path
example value: %2Fcss%2Fsite.css%3Fx%3D123%26y%3D345
notes:
must start with a /

variable: origin
description: Set the origin server of the file
example value: http://www.yoursite.com
notes:
must include the protocol e.g. http://
must not include a trailing /
can include a port and sub-directory

variable: origin_host
description: Override Host: header when requesting files from origin
example value: www.yoursite.com
notes: must not include the protocol e.g. http://

variable: protocol
description: Allowed client protocol
options: http | https+spdy | any

variable: include_query
description: Enable include query-string in cache uniqueness
options: 0 | 1
notes: do not use this option with flv/mp4 pseudo-streaming

variable: use_query
description: Enable include query-string in caching request but not in cache uniqueness
options: 0 | 1

variable: httplive
description: Enable special handling of http live streaming formats (HLS, HDS, DASH, MSS)
options: 0 | 1
notes: use only for LIVE streaming, not for VOD

variable: httplive_expires
description: Set a lower than normal expiry time for http live streaming playlist/manifest files
example value: 5
notes: use only for LIVE streaming, not for VOD

variable: vod_types
description: Set the allowed VOD formats when using VOD Transcoding
example value: hls,dash
notes:
comma separated list of possible formats: rtmp, rtsp, hls, hds, dash, mss
users will receive a 403 Forbidden response if their IP address does not match

variable: limit
description: Set a download speed limit in bytes per second
example value: 200000
notes: can include an abbreviation e.g. k or m

variable: limitafter
description: Send the file at full speed for this many bytes before limit takes effect
example value: 2000000
notes: can include an abbreviation e.g. k or m

variable: addheaders
description: Add headers to the HTTP response when sending to client
example value: X-Test%3A%20hello,X-Something%3A%20test1%3Btest2%2Ctest3
notes:
Comma separated Header: Value format
Header: Value pairs should be URL encoded, but not the commas separating them

variable: keepheaders
description: Keep headers from the origin response when sending to client
example value: X-Test,X-Something
notes: Comma separated header names

variable: removeheaders
description: Remove headers from the origin response
example value: X-Test,X-Something or 20x=X-Test,X-Something
notes:
Comma separated header names
Only applicable for non-cached files

variable: proxy_headers
description: Enable client’s request headers be in included in origin cache HTTP request
options: 0 | 1

variable: proxy_add_headers
description: Add headers to the origin HTTP request
example value: X-Proxy: true,X-CDN: Hibernia
notes:
Comma separated Header: Value format
Header: Value pairs should be URL encoded, but not the commas separating them

variable: proxy_remove_headers
description: List of headers to be removed from the origin HTTP request
example value: Accept,Cookie

variable: obey_origin_headers
description: Enable obey caching rules set by origin response headers
options: 0 | 1

variable: obey_client_headers
description: Enable obey caching rules set by client request headers
options: 0 | 1

variable: obey_vary_header
description: Enable obey Vary header set by origin response
options: 0 | 1

variable: via
description: Enable Via response header
options: 0 | 1

variable: gz
description: explicitly enable gzip compression (if supported by client)
options: 0 | 1

variable: salt
description: add a salt (cryptography term) to the cache uniqueness
example value: 1427209459
notes:
Best used as a way to selectively expire/update/re-cache files when they are altered, without having to call our API
If you record the modified time of files, or a revision number in your database, then include that as the salt value. This will greatly lessen the chance of stale files being served from cache.

variable: log
description: add text to the end of the log line
options: clientid=1234

Real-Time Live Zone-Only Variables

please note: stream variable must always be set in the encrypted string

variable: stream
description: the value should match the stream (the name of the publish or pull point) in the URL
example value: if the URL is rtmp|rtsp://cdn.yoursite.com/live/zoneabcd_stream1234_HEXSTRING then the value should be stream1234
notes:
It stops the encrypted string from being transferred to a different stream URL

variable: mode
description: controls what the client is allowed to do with the stream
options: play | publish
notes:
publish – allows the user to publish or play a stream
play (default if omitted) – allows the user to play a published or pulled stream

variable: do_not_drop
description: Disable dropping all connections on unpublish
example value: 0 | 1

variable: client_api_notify_url
description: Url of client api to recieve play + publish events
notes: Sent as HTTP POST requests in json format
example value: http://api.yoursite.com/livestreamnotify

variable: tag
description: Arbitrary text set by the user to transfer variables to notify and log entries
notes: Should be url-encoded
example valueuserid%3D1234

Shared Variables

Variables that can be used with Sites, HTTP Live Zones, and Real-Time Live Zones

variable: referer
description: Allow requests only from this referer
example value: www.mysite.com/pages/article-3874.html
notes:
comma separated list of allowed referers
do not include protocol

variable: blacklist
description: Prevent IP addresses from certain countries from downloading
example value: CN,VN,IN
notes:
comma separated, 2 letter ISO 3166 Country Codes
blacklisted users will receive a 403 Forbidden response

variable: whitelist
description: Allow only IPs from certain countries to download
example value: US,GB,NL
notes:
comma separated, 2 letter ISO 3166 Country Codes
non-whitelisted users will receive a 403 Forbidden response

variable: ttl
description: Set a time when this link will stop working
example value: 1364213357
notes:
unix time stamp in UTC time zone
users will receive a 410 Gone response after this time

variable: restrict
description: Restrict the link to this IP address
example value: 66.249.76.163
notes: users will receive a 403 Forbidden response if their IP address does not match

To try/test encrypted link variables you can use our Encrypted Link Generator tool

Encrypted Link Generator

Leave a Reply

Your email address will not be published. Required fields are marked *