Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:02:44+00:00 2026-06-14T21:02:44+00:00

Shoutcast servers not generate valid HTTP resource. Our mobile player link (Android) requires a

  • 0

Shoutcast servers not generate valid HTTP resource. Our mobile player link (Android) requires a valid HTTP resource. How can i use php script for shoutcast stream? This script provide valid http resource? Any one knows?

<?php

$track = "shoutcaststream.mp3";

if (file_exists($track)) {
    header("Content-Type: audio/mpeg");
    header('Content-Length: ' . filesize($track));
    header('Content-Disposition: inline; filename="shoutcaststream.mp3"');
    header('X-Pad: avoid browser bug');
    header('Cache-Control: no-cache');
    readfile($track);
    exit;
} else {
    header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
    echo "no file";
}

Update 2

Everything now fine asper “Brad” instructions. We use set_time_limit(0) But still my stream closed after 3 mins to 5 mins? How to fix? Kindly help me.. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:02:45+00:00Added an answer on June 14, 2026 at 9:02 pm

    Yes, what you have is valid.

    The invalid part about SHOUTcast streams is that they return ICY 200 OK instead of HTTP/1.0 200 OK in their responses. If you wish to change your script to proxy the SHOUTcast request, you will likely need to connect to your SHOUTcast server via a normal TCP connection (see fsockopen()), and send the raw request data.

    Once you have a connection and are receiving data, echo this data out to your client.

    Also note that you will want to call set_time_limit(0) so that your script doesn’t time out in 30 seconds or so. Also make sure to not send a Content-Length header, and set your response to be HTTP/1.0 so that you don’t have to send the data as chunked. (Chunked encoding playback only works on Android 2.3 or later.)

    Finally, if you find that hacking something in place with PHP is too much of a hassle, I have a stream hosting service available for testing that does exactly what you are asking, which works fine for the built-in audio player on Android.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with
Using the native Android MediaPlayer class I am able to play Shoutcast streams. Furthermore,
I am writing an app for Android that grabs meta data from SHOUTcast mp3
I want to provide audio data into SHOUTcast or Icecast servers without using their
i have a IcyStreamMeta.class that gets the metadata info of shoutcast Stream i use
I am trying to build a flash player for my company's Shoutcast server, and
I've created an erlang application where I can use application:start(Name) to successfully start the
I am using Node's basic http.request() function without problem on normal HTTP servers. I
I'm looking for a web player to play a music stream from a SHOUTcast
i am getting errors/exceptions on my service which i use to stream a shoutcast.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.