Skip to content

Conversation

@TrianguloY
Copy link
Contributor

@TrianguloY TrianguloY commented Oct 16, 2020

When fetching a resource, try directly first. If it throws an error, then try with proxies.
Fixes #95
Should also reduce drastically the petitions to the proxy servers (will only be made if the non-proxy fails)

[Note: I tested it with some urls, but probably more tests are needed before merge]

Edit: test links:
https://trianguloy.github.io/htmlpreview.github.com/?https://www.dropbox.com/s/mgw65rktedx4pjl/Hello%32world.html?raw=1
https://trianguloy.github.io/htmlpreview.github.com/?https://github.com/twbs/bootstrap/gh-pages/2.3.2/index.html
https://trianguloy.github.io/htmlpreview.github.com/?https://github.com/documentcloud/backbone/blob/master/examples/todos/index.html

When fetching a resource, try directly first. If it throws an error, then try with proxies.
Fixes htmlpreview#95
Should also reduce drastically the petitions to the proxy servers (will only be made if the non-proxy fails)
@FranklinYu
Copy link

I think we can also remove https://yacdn.org/proxy/, which no longer works?

@niutech niutech merged commit 787b673 into htmlpreview:master Jul 11, 2021
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.

TypeError: NetworkError when attempting to fetch resource.

3 participants