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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:52:52+00:00 2026-06-13T22:52:52+00:00

I develop a light web server in java (very very light) , his purpose

  • 0

I develop a light web server in java (very very light) , his purpose is mainly to stream audio.

on a webpage i have a simple html5 audio tag. When i load the page in a browser the browser make a GET request for the audio file and it’s working fine.
But when i pause/play or seek , the browser make a request at X bytes with Range condition

GET /audio/3f6dbbd6adcb5eb4ea4cd981f30a6c409727bbf202367df18d4dd1a91a959fdb HTTP/1.1
Host: localhost:8888
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.16 (KHTML, like Gecko) Chrome/24.0.1304.0 Safari/537.16
Accept: */*
Referer: http://localhost:8888/stream/3f6dbbd6adcb5eb4ea4cd981f30a6c409727bbf202367df18d4dd1a91a959fdb
Accept-Language: en-US,en;q=0.8,fr;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Range: bytes=360448-

and i made my sever reply a 206 Partial Content with condition:

HTTP/1.1 206 Partial Content
Date : Wed Nov 07 08:07:32 CET 2012
Content-Length:11126914
Content-Range: bytes 360448-11487361
Accept-Ranges: bytes
Content-Type : audio/mpeg

following of course by the binary data starting at 360448 bytes, but the browser doesn’t seem to like it , when i watch the network data on the browser , it doesn’t even seem to get the reply (connection is marked as canceled).

I tried to watch what happen with an apache server but thats kind of hard because the browser always use 200 (cache) wich mean it use the cached version of the mp3 so no request to the server.

I tried cheating and using another response number like 200 or even 304 (some server seem to use it) but no luck here.

What do i do wrong in this process ?
i can provide more log if it’s needed

  • 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-13T22:52:53+00:00Added an answer on June 13, 2026 at 10:52 pm

    According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16, the header should be

    Content-Range: bytes 360448-11487361/11487362
    

    11487362 being the full size of the file, with 11487361 being the last 0-based byte offset.

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

Sidebar

Related Questions

I am used to develop web applications in Java (Struts, Spring, JSP...). But now
I have a web app(jsp/servlets) which allows users to download audio files and play
I develop a client-server application and I have log in the server, so I
I have used Access 2003 to develop a frontend to a SQL Server database.
I currently develop a metro style app using mvvm light framework. I have some
I have a public class called Profile . Very simple model class currently with
I develop a web by using ASP.NET MVC2. Creating the cookie in the background.
im develop app with phonegap and create index.html -> html5 and of course use
I develop one book reader application which play audio according to page, but problem
I develop a Java application with 4 tiers : database (MySQL), persistence (JPA), business

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.