Skip to content

WIP Adding proxying support - #40

Merged
mat merged 23 commits into
mat:masterfrom
karl-ravn:proxy
Oct 30, 2019
Merged

WIP Adding proxying support#40
mat merged 23 commits into
mat:masterfrom
karl-ravn:proxy

Conversation

@karl-ravn

Copy link
Copy Markdown
Contributor

Sometimes this service needs to be hidden behind friendly lines and not exposing the exact URL for the favicon resource that was requested. Sometimes you get mixed results when your own service runs https but the favicon is supposed to be downloaded from http - causing everything to break and emit errors.

Running the server with DOWNLOAD_MODE=proxy makes the server download and forward the resource to the user.

@galgolan

galgolan commented Jun 4, 2019

Copy link
Copy Markdown

This is a great and useful feature!
I started the code with DOWNLOAD_MODE=proxy but the server behaves the same...

@karl-ravn

Copy link
Copy Markdown
Contributor Author

Sorry for not responding back earlier. When the server is started with DOWNLOAD_MODE=proxy, it's supposed to almost behave the same. However, there are two main differences:

with current non-proxy mode:

59001:~ karrav$ curl --head http:'//localhost:3000/icon?url=www.marketwatch.com&size=32'
HTTP/1.1 302 Found
Cache-Control: max-age=2592000
Content-Type: text/html; charset=utf-8
Location: https://mw4.wsj.net/mw5/content/logos/favicon.ico
Date: Thu, 05 Sep 2019 11:43:17 GMT

with proxy-mode:

59001:~ karrav$ curl --head http:'//localhost:3000/icon?url=www.marketwatch.com&size=32'
HTTP/1.1 200 OK
Cache-Control: max-age=2592000
Date: Thu, 05 Sep 2019 11:39:17 GMT
Content-Type: image/png

The main difference here would be that the icon binary will be sent over the request instead of being redirected to there.

@mat

mat commented Sep 15, 2019

Copy link
Copy Markdown
Owner

Thanks @karl-ravn for this contribution and sorry for getting back so late :(

I, too, think this is useful for some people.

Some suggestion before we merge:

@karl-ravn karl-ravn changed the title Adding proxying support WIP Adding proxying support Oct 21, 2019
@karl-ravn

Copy link
Copy Markdown
Contributor Author

Ok, I've done 1,2 and 4 but writing a good unit test for this... it's a bit tricky since I'm not really a Go developer..

@immanuelfodor

Copy link
Copy Markdown

I've just found this project searching for a favicon proxy, this PR would be so great to have :)

@mat
mat merged commit 258777f into mat:master Oct 30, 2019
@mat

mat commented Oct 30, 2019

Copy link
Copy Markdown
Owner

Thanks @karl-ravn for adding this feature.

I'm going to add a test and will release a new version soon, too.

mat added a commit that referenced this pull request Oct 30, 2019
@csandman

Copy link
Copy Markdown

@mat is there any way to access this var when using the docker image? It appears its not currently available, and I don't see SERVER_MODE in the docker file.

@mat

mat commented Dec 10, 2019

Copy link
Copy Markdown
Owner

@csandman Good catch, I failed to release a new version of the Docker image! The latest docker image is now up to date and contains support for SERVER_MODE: https://hub.docker.com/r/matthiasluedtke/iconserver/latest

mat added a commit that referenced this pull request Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants