search by tags

for the user

adventures into the land of the command line

akamai staging... wah?

How to test an Akamai staging endpoint:

Go to your config and get your edge hostname:

something.cool.io-v1.edgekey.net

Modify it to look like this:

something.cool.io-v1.edgekey-staging.net

Find it’s ip address:

$ dig something.cool.io-v1.edgekey-staging.net
.
.
e4655.h.akamaiedge-staging.net. 20 IN   A   123.45.678.90

Spoof the DNS

$ vim /etc/hosts
123.45.678.90   something.cool.io

cURL that shiz

$ curl -IXGET https://something.cool.io/blah/pepepow/master.m3u8

ORRRRRR

Just do a cURL to akamai’s staging domain (edge hostname) with the host header set as your domain name, remember to use -k for https as the cert wont match:

$ curl -k -H "Host: something.cool.io" -IXGET https://something.cool.io-v1.edgekey-staging.net/blah/pepepow/master.m3u8

HTTP/1.1 200 OK
Server: nginx
Content-Length: 211
Accept-Ranges: bytes
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: no-cache
Date: Thu, 20 Jul 2017 08:56:08 GMT
Connection: keep-alive
Content-Type: application/x-mpegURL
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Server,range,hdntl,hdnts
Access-Control-Allow-Headers: origin,range,hdntl,hdnts
Access-Control-Allow-Methods: GET,POST,OPTIONS
Access-Control-Allow-Origin: *
X-Akamai-Staging: ESSL

PRODUCTION EXAMPLE

$ curl -IXGET https://something.cool.io/blah/pepepow/master.m3u8

STAGING EXAMPLE

$ curl -k -H "Host: something.cool.io" -IXGET https://something.cool.io-v1.edgekey-staging.net/blah/pepepow/master.m3u8