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 549951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:14:16+00:00 2026-05-13T11:14:16+00:00

I am creating a simple Proxy server for my website. Why I am not

  • 0

I am creating a simple Proxy server for my website. Why I am not using mod_proxy and mod_cache is a different discussion. Here’s the code:

    shell_exec("nohup curl --create-dirs -o {$write_path} {$source_url} > /dev/null 2> /dev/null & echo $!");
    sleep(1);

    $read_speed = 65.5; # 65.5 kb/s download rate
    $handle = fopen($write_path, "rb");

    $content_type = select_meta_item($headers, 'Content-Type');
    $file_size = select_meta_item($headers, 'Content-Length');
    send_headers($content_type, $file_size); 
    flush();

    while (!feof($handle))
    {
        echo fread($handle, round($read_speed * 1024));
        flush();
        sleep(1);
    }

    fclose($handle);

Streaming an MP3 doesn’t work using this method. Plays in Chrome, but not in Firefox. Initially I’ll be using this to stream MP3 files through Long Tail’s JW Player. If it all works out, I’ll also be using this to send ZIP files.

  • 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-05-13T11:14:16+00:00Added an answer on May 13, 2026 at 11:14 am

    I figured it out. The code it works fine.

    The file was being called by APACHE by the 404 handler (ErrorDocument). Apache automatically sent the 404 header prior to the PHP script being called.

    This file (code above), not starts the CURL process and redirects to a file that streams. Since Apache returned the 404, Firefox ignored the MP3 response. (whereas Chrome didn’t). Now that I redirect, it works fine.

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

Sidebar

Related Questions

I'm creating simple proxy server but I faced a strange situation, I've following code
I'm creating a reverse HTTP proxy using Node.js for fun. The code is pretty
Creating a simple RPG game, first time using XNA. Trying to get my character
I'm creating a simple HTTP proxy that will sit between mobile apps and a
I'm creating simple circle control (with center and radius properties) based on ellipse. Code
I'm using a simple ajax-enabled WCF service. I'm creating a string of XML on
I am creating simple blog web application using play framework and i want to
Creating simple app using GAE / Django-nonrel (I don't think the problem is specific
I'm creating a simple game using HTML and CSS. I have a background image
I'm creating a website using Entity Framework (4.1), which exposes WCF services, and I

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.