FAQ
Hello,
I'm currently learning go in my freetime and have a problem I just can't
get to work.
I basically want to have a simple fileserver and being able to play html5
audio/video.
My problem however is, that I'm not able to seek in the videos and getting
a 200 OK response from the server in chrome, but not in firefox, which
causes the network connection to close and the video just stops

I found a lot about chrome having caching issues,server not alowing partial
content.
I already switched between http.ServeFile and http.FileServer for the
networkpath and passing it later as the videosource in video-tag.

Does anyone know how to work around this weird behaviour?
Please let me know if you need aditional information or code snippets. I
don't know what else to do.

I'm not a professional programmer, just doing it to learn something and to
have fun

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Rajko Hartmann at Mar 14, 2015 at 9:16 am
    some additional information i forgot to mention. The whole thing happens
    over ssl, and it works with self signed certificates, but not, when I sign
    it by startcom, cacertificates etc. It also works all good, when in
    inspector I disable caching in chrome

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tamás Gulácsi at Mar 14, 2015 at 10:06 am
    Can you share code?
    Have you debugged with wireshark, what requests happen, what are the responses... Etc?
    Even the server log could help.

    You point on SDL: does it work without SSL?

    So please try to narrow the problem.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rajko Hartmann at Mar 14, 2015 at 10:24 am
    The setup is pretty basic. This is the Path in Main() that is supposed to
    serve the Files.
    http.Handle("/data/", auth.Chkauth(view.HandlerToHandleFunc(http.StripPrefix
    ("/data/", http.FileServer(http.Dir("./data/"))))))

    The html-Template works like this.
    <video width="1280" height="720" preload="auto" controls><source src=
    "{{$v.Source}}" type="video/webm"> {{if $v.Subpath}}<track src=
    "{{$v.Subpath}}" kind="subtitle" src="de-DE" label="german">{{end}}
      Your browser does not support the video tag.</video>

    I play a video in chrome and get...
    Request
    GET /data/path/to/webm/video.webm HTTP/1.1
    Host: myhost
    Connection: keep-alive
    Accept-Encoding: identity;q=1, *;q=0
    User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/43.0.2327.5 Safari/537.36
    Accept: */*
    Referer: https://host/files/path/to/webm/video.webm
    Accept-Language: en-US,en;q=0.8,de;q=0.6
    Cookie: justmycookie
    Range: bytes=0-


    response:
    HTTP/1.1 206 Partial Content
    Accept-Ranges: bytes
    Content-Length: 869048311
    Content-Range: bytes 0-869048310/869048311
    Content-Type: video/webm
    Last-Modified: Sat, 14 Feb 2015 09:10:26 GMT
    Date: Sat, 14 Mar 2015 10:15:12 GMT


    Now when I try to seek in the video and jump to somewhere in the middle.
    Request:
    GET /data/path/to/webm/video.webm HTTP/1.1
    Host: myhost
    Connection: keep-alive
    Accept-Encoding: identity;q=1, *;q=0
    User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/43.0.2327.5 Safari/537.36
    Accept: */*
    Referer: https://host/files/path/to/webm/video.webm
    Accept-Language: en-US,en;q=0.8,de;q=0.6
    Cookie: justmycookie
    Range: bytes=869021010-869048310
    If-Range: Sat, 14 Feb 2015 09:10:26 GMT


    Response:
    HTTP/1.1 200 OK
    Accept-Ranges: bytes
    Content-Length: 869048311
    Content-Type: video/webm
    Last-Modified: Sat, 14 Feb 2015 09:10:26 GMT
    Date: Sat, 14 Mar 2015 10:15:16 GMT



    This should be a really basic setup shouldn't it?

    On Saturday, March 14, 2015 at 11:06:26 AM UTC+1, Tamás Gulácsi wrote:

    Can you share code?
    Have you debugged with wireshark, what requests happen, what are the
    responses... Etc?
    Even the server log could help.

    You point on SDL: does it work without SSL?

    So please try to narrow the problem.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rajko Hartmann at Mar 14, 2015 at 10:42 am
    I Just checked the Rest. As i said, it works, when the certificate for ssl
    is selfsigned. It works, when I disable caching in chrome which would send
    Cache-control: nocache in request and it works, if I don't use SSL at all

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rajko Hartmann at Mar 14, 2015 at 3:08 pm
    I did some additional testing over the past few hours. And this is what I found.

    Everything works on local machine.
    When I run it on a remote machine it doesn't. Even without SSL the connection breaks when seeking the video.
    The response headers are always the same.
    I switched from http.FileServer so http.ServeFiles but that didn't change anything.
    I tested on two different machines. One Debian testing and one arch Linux. Both didn't work out.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 14, '15 at 8:54a
activeMar 14, '15 at 3:08p
posts6
users2
websitegolang.org

2 users in discussion

Rajko Hartmann: 5 posts Tamás Gulácsi: 1 post

People

Translate

site design / logo © 2022 Grokbase