Getting URL of a shoutcast server....

Andrew Kluthe andrew at ctech.me
Mon Jul 8 13:26:59 EDT 2013


So basically you just need to trick it into recognizing your user agent it
seems.

As far as getting into the authorized parts of your site,

 libURLSetCustomHTTPHeaders "GET / HTTP/1.1" & cr & "Authorization: Basic "
& base64Encode("username:password") & cr &"User-Agent: Mozilla/5.0 (Windows
NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116
Safari/537.36"

should do the trick. This sets the basic auth that shoutcast servers use to
a base64encoded string of your username and password for the authorized
parts of your shoutcast server.

You might have the jiggle the handle a little bit with the headers in case
they are checking the Referer or something. Here is a full header info of
the unauthorized request I made to your admin page.

Request URL:http://stream-11.streamsolutions.co.uk:9428/admin.cgi
Request Method:GET
Status Code:401 Unauthorized

Request Headers

GET /admin.cgi HTTP/1.1
Host: stream-11.streamsolutions.co.uk:9428
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic dGVzdDp0ZXN0 <----- this here is just the string
test:test base64encod'd
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/27.0.1453.116 Safari/537.36
Referer: http://stream-11.streamsolutions.co.uk:9428/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

Response Headers
HTTP/1.0 401 Unauthorized
Server: Shoutcast DNAS
WWW-authenticate: basic realm="Shoutcast Server"
Content-type: text/html



On Mon, Jul 8, 2013 at 11:19 AM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:

> Hi Andrew,
>
> That must be it. The httpHeaders (or libUrlCustomHttpHeaders) are empty by
> default. However, if I check the user agent by connecting to a PHP script
> on my server, the server says the agent is "Revolution (MacOS)" or
> "LiveCode (MacOS)", even though the httpHeaders are empty.
>
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/**xtalkprogrammer<http://twitter.com/xtalkprogrammer>
> KvK: 50277553
>
> Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour
> spaces. http://www.color-converter.com
>
> Buy my new book "Programming LiveCode for the Real Beginner"
> http://qery.us/3fi
>
> Fill out this survey please
> http://livecodebeginner.**economy-x-talk.com/survey/<http://livecodebeginner.economy-x-talk.com/survey/>
>
> On 7/8/2013 17:43, Andrew Kluthe wrote:
>
>> What does livecode's user-agent read as by default? Is it possible that
>> the
>> shoutcast server is not recognizing the user agent livecode presents and
>> therefore not sending data?
>>
>> on mouseUp
>>     libURLSetCustomHTTPHeaders "GET / HTTP/1.1" & cr &"User-Agent:
>> Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)
>> Chrome/27.0.1453.116 Safari/537.36"
>>     put URL"http://stream-11.**streamsolutions.co.uk:9428/<http://stream-11.streamsolutions.co.uk:9428/>"
>> into sUrl
>>     answer sUrl
>> end mouseUp
>>
>> produces the expected results for me.
>>
>>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



-- 
Regards,

Andrew Kluthe
andrew at ctech.me



More information about the use-livecode mailing list