mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[GH-ISSUE #2896] [bug]: Only able to access echo.hoppscotch.io when using docker #936
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#936
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @WayneNani on GitHub (Jan 5, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2896
Is there an existing issue for this?
Current behavior
When I create a new docker container with
docker run --rm --name hoppscotch -p 3000:3000 hoppscotch/hoppscotch:latestit will create the local version of hoppscotch with no problems. I can also connect to it and get a response from echo.hoppscotch.io, but as soon as I try to access a different URL (i.e. hoppscotch.io) it will fail with "Request could not be sent. API endpoint is not available" which of course should not be an issue.Steps to reproduce
docker run --rm --name hoppscotch -p 3000:3000 hoppscotch/hoppscotch:latestEnvironment
Production
Version
Self-hosted
@AndrewBastin commented on GitHub (Jan 6, 2023):
This is an expected behaviour.
You can fix this by installing the Hoppscotch browser extension and adding your container URL (in your case
localhost:3000). Then you can use "Browser Extension" on the interceptor menu.Alternatively you can also self host Proxyscotch if you want to run it as a proxy.
Do let me know if you need more help or if this fixed your issue, please close this ticket!
@WayneNani commented on GitHub (Jan 6, 2023):
This solved the issue, thank you. Could you explain shortly why this is necessary, or point me to resources explaining it? I was under the impression that hoppscotch should work "out of the box" when I run the container.
@AndrewBastin commented on GitHub (Jan 6, 2023):
@WayneNani this is a client side limitation. The current container we provide is fully client side (which means its just a static site rendered on the browser). The browser has a security policy called CORS (read more here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) which restricts Hoppscotch's ability to send requests to certain domains.
The extension provides a workaround from CORS just for Hoppscotch to send requests on without issues.
Since your problem was solved, I am marking this issue as closed.