Giter Club home page Giter Club logo

Comments (5)

n0vad3v avatar n0vad3v commented on July 20, 2024 1

No problem 😉, I've also updated documentation (webp-sh/docs.webp.sh@ac53f80) to make it clearer for users to read.

from webp_server_go.

n0vad3v avatar n0vad3v commented on July 20, 2024

Thanks for feedback, could you add some more details about this issue:

  • What's your original image address, is it https://test-media.ams3.digitaloceanspaces.com/image/thumbnail/0000120d-0ce3-4daa-b8e1-f460d88e0fb7.jpg ?
  • What are the logs from WebP Server Go after executing cURL command.

from webp_server_go.

greenhost87 avatar greenhost87 commented on July 20, 2024

@n0vad3v

  • I upload image to another bucket

  • In docker logs I have only two lines

time="2023-09-26 15:08:33" level=info msg="WebP Server Go ready." func="[46:main.setupLogger]"
WebP Server Go is Running on http://127.0.0.1:3333

Current config

{
  "HOST": "127.0.0.1",
  "PORT": "3333",
  "QUALITY": "80",
  "IMG_PATH": "/opt/pics",
   "IMG_MAP": {
    "http://test.mydomain.com": "https://bf-test-media.ams3.digitaloceanspaces.com"
  },
  "EXHAUST_PATH": "/opt/exhaust",
  "ALLOWED_TYPES": ["jpg","png","jpeg","bmp","gif","svg"],
"ENABLE_EXTRA_PARAMS": true
}

My curl that I run on docker host:
curl -H 'Host: test.mydomain.com' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' http://127.0.0.1:3333/image/thumbnail/0000120d-0ce3-4daa-b8e1-f460d88e0fb7.jpg -v

Curl response is

*   Trying 127.0.0.1:3333...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 3333 (#0)
> GET /image/thumbnail/0000120d-0ce3-4daa-b8e1-f460d88e0fb7.jpg HTTP/1.1
> Host: test.mydomain.com
> User-Agent: curl/7.68.0
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
>
* Empty reply from server
* Connection #0 to host 127.0.0.1 left intact
curl: (52) Empty reply from server

from webp_server_go.

n0vad3v avatar n0vad3v commented on July 20, 2024

Oh, I think I got the reason!

Your config is written "HOST": "127.0.0.1", , thus WebP Server is listening on http://127.0.0.1:3333 inside your container, thus it's not able to serve requests from outside of the container.

You should change "HOST": "127.0.0.1", to "HOST": "0.0.0.0",.

I've tested and it's working after changing HOST.

curl -H 'Host: test.mydomain.com' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7'  http://127.0.0.1:3333/image/thumbnail/0000120d-0ce3-4daa-b8e1-f460d88e0fb7.jpg
Warning: Binary output can mess up your terminal. Use "--output -" to tell 
Warning: curl to output it to your terminal anyway, or consider "--output 
Warning: <FILE>" to save to a file.

Logs from WebP Server Go:

time="2023-09-26 15:35:56" level=info msg="Remote Addr is https://bf-test-media.ams3.digitaloceanspaces.com/image/thumbnail/0000120d-0ce3-4daa-b8e1-f460d88e0fb7.jpg, pinging for info..." func="[81:webp_server_go/handler.fetchRemoteImg]"
time="2023-09-26 15:35:57" level=warning msg="can't read metadata: open metadata/bf-test-media.ams3.digitaloceanspaces.com/16da62fb3a2c526b.json: no such file or directory" func="[36:webp_server_go/helper.ReadMetadata]"
time="2023-09-26 15:35:57" level=info msg="Remote file not found in remote-raw, re-fetching..." func="[88:webp_server_go/handler.fetchRemoteImg]"
time="2023-09-26 15:35:58" level=info msg="WebP@80%: remote-raw/bf-test-media.ams3.digitaloceanspaces.com/16da62fb3a2c526b->/opt/exhaust/bf-test-media.ams3.digitaloceanspaces.com/16da62fb3a2c526b.webp 87721->47028 53.61% deflated" func="[295:webp_server_go/encoder.convertLog]"
time="2023-09-26 15:35:58" level=warning msg="/opt/exhaust/bf-test-media.ams3.digitaloceanspaces.com/16da62fb3a2c526b.avif not found on filesystem" func="[174:webp_server_go/helper.FindSmallestFiles]"
 - [2023-09-26 15:35:56] GET /image/thumbnail/0000120d-0ce3-4daa-b8e1-f460d88e0fb7.jpg 200  curl/8.0.1

from webp_server_go.

greenhost87 avatar greenhost87 commented on July 20, 2024

@n0vad3v Yes, now it work's... but I have no idea how to figure that out without your help

from webp_server_go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.