Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200 when starting a pygame project #107

Open
HansBug opened this issue Aug 9, 2023 · 5 comments
Labels
wontfix This will not be worked on

Comments

@HansBug
Copy link

HansBug commented Aug 9, 2023

This is the code we are using: https://github.com/HansBug/pygame_demo

When the page of pygbag is opened, it stuck at the Downloading page.

This is the full console log on chrome browser

GET http://localhost:8000//archives/0.7//browserfs.min.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200
127.0.0.1/:405 Unrecognized feature: 'monetization'.
127.0.0.1/:405 Unrecognized feature: 'xr'.
127.0.0.1/:405 Allow attribute will take precedence over 'allowfullscreen'.
pythons.js:1582 Connection: Wired
(anonymous) @ pythons.js:1582
pythons.js:1969 AUTOSTART http://localhost:8000//archives/0.7/pythons.js http://127.0.0.1:8000/ undefined
pythons.js:1978 pythons found at http://localhost:8000//archives/0.7/pythons.js
pythons.js:1992 TODO: merge/replace location options over script options
auto_conf @ pythons.js:1992
auto_start @ pythons.js:2167
(anonymous) @ pythons.js:2211
pythons.js:1996 Location taking precedence over script http://localhost:8000//archives/0.7/pythons.js => http://localhost:8000//archives/0.7/pythons.js?#
pythons.js:2000 pythons found at http://localhost:8000//archives/0.7/pythons.js?# (2) ['http://localhost:8000//archives/0.7/pythons.js?', '']
pythons.js:2009 pythons found at http://localhost:8000//archives/0.7/pythons.js? (2) ['http://localhost:8000//archives/0.7/pythons.js', '']
pythons.js:2011 pythons found at http://localhost:8000//archives/0.7/pythons.js ['']
pythons.js:2035 no python implementation specified, using default : cpython
pythons.js:2124 config.xtermjs = 1
pythons.js:2124 config._sdl2 = canvas
pythons.js:2124 config.user_canvas = 1
pythons.js:2124 config.user_canvas_managed = 0
pythons.js:2124 config.ume_block = 1
pythons.js:2124 config.can_close = 0
pythons.js:2124 config.archive = pygame_demo
pythons.js:2124 config.gui_debug = 3
pythons.js:2124 config.cdn = http://localhost:8000//archives/0.7/
pythons.js:2124 config.autorun = 0
pythons.js:2124 config.PYBUILD = 3.11
pythons.js:2124 config.debug = false
pythons.js:2124 config.interactive = false
pythons.js:2124 config.cols = 132
pythons.js:2124 config.lines = 42
pythons.js:2124 config.quiet = false
pythons.js:2124 config.features = (4) ['vtx', 'fs', 'snd', 'gui']
pythons.js:2124 config.pydigits = 311
pythons.js:2124 config.executable = http://localhost:8000//archives/0.7/python311/main.js
pythons.js:2126 interpreter= cpython
pythons.js:2127 orig_argv ['']
pythons.js:2128 sys.argv:  ['']
pythons.js:2129 docurl= http://127.0.0.1:8000/
pythons.js:2130 srcurl= http://localhost:8000//archives/0.7/pythons.js
pythons.js:2132 data-os= undefined
pythons.js:2133 data-python= undefined
pythons.js:2134 script: id= undefined
pythons.js:2135 code :  5082  as undefined.py
pythons.js:2191 auto_start done
auto_start @ pythons.js:2191
(anonymous) @ pythons.js:2211
127.0.0.1/:259          GET http://localhost:8000//archives/0.7/pythonrc.py net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200
127.0.0.1/:260          GET http://localhost:8000//archives/0.7/vt/xterm.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200
127.0.0.1/:261          GET http://localhost:8000//archives/0.7/vt/xterm-addon-image.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200
VM10:6748 crbug/1173575, non-JS module files deprecated.
(anonymous) @ VM10:6748
pythons.js:1825 


== FLAGS : is_mobile(false) dev=false debug_user=false debug_mobile=false ==




onload @ pythons.js:1825
load (async)
auto_start @ pythons.js:2166
(anonymous) @ pythons.js:2211
vtx.js:23 Terminal+ImageAddon importing from CDN : http://localhost:8000//archives/0.7/vt/
vtx.js:34          GET http://localhost:8000//archives/0.7/vt/xterm.css net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200
(anonymous) @ vtx.js:34
DevTools failed to load source map: Could not load content for http://localhost:8000//archives/0.7/vt/xterm.js.map: System error: net::ERR_BLOCKED_BY_RESPONSE
vtx.js:70 terminal 132 42 {url: 'http://localhost:8000//archives/0.7/xtermjsixel/xterm-addon-image-worker.js', sixelSupport: true}
WasmTerminal @ vtx.js:70
feat_vtx @ pythons.js:941
await in feat_vtx (async)
onload @ pythons.js:1895
load (async)
auto_start @ pythons.js:2166
(anonymous) @ pythons.js:2211
pythons.js:829 late import http://localhost:8000//archives/0.7/browserfs.min.js
feat_fs @ pythons.js:829
onload @ pythons.js:1877
load (async)
auto_start @ pythons.js:2166
(anonymous) @ pythons.js:2211
DevTools failed to load source map: Could not load content for http://localhost:8000//archives/0.7/vt/xterm-addon-image.js.map: System error: net::ERR_BLOCKED_BY_RESPONSE
pythons.js:832          GET http://localhost:8000//archives/0.7/browserfs.min.js net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200

It seems that there is cross origin problem on this web service? So how to solve this.

Our environment:

  • Python 3.8.1
  • Chrome 108.0.5359.124, 64bit
  • Full pip list
pygame==2.5.0
pygbag==0.7.1
PySocks==1.7.1
token-utils==0.1.8
@pmp-p
Copy link
Member

pmp-p commented Aug 9, 2023

you can't mix 127.0.0.1 and localhost url, only use localhost or browser restrictions will apply.

@HansBug
Copy link
Author

HansBug commented Aug 9, 2023

you can't mix 127.0.0.1 and localhost url, only use localhost or browser restrictions will apply.

Okay, fine. However, is there a way to remove these restrictions? This can actually be inconvenient for users.

Additionally, when I use pygbag --bind 0.0.0.0 pygame_demo to start the game (expecting the effect of unrestricted IP access within the same LAN through the port), an error appears on the page, and the address for accessing static resources is https://0.0.0.0:8000/xxxx. Is there a way to solve this issue?

@pmp-p
Copy link
Member

pmp-p commented Aug 9, 2023

is there a way to remove these restrictions

no all browsers enforce them, the only hostname relaxed is "localhost"

Keep also in mind too that other restrictions may apply when hosting on Non-ssl (either wan or lan ) like camera/micro access and outgoing ssl connexions prohibited.

either use pygbag localhost , or use a ssl enabled server.

@pmp-p pmp-p added the wontfix This will not be worked on label Aug 22, 2023
@Blue-Robin-Taken
Copy link

dangit I have the same problem too

what should I do now? I want people to access my game through that URL & my ssh server that my school provides only allows for that URL. Therefore, how do I enable SSL?

@pmp-p
Copy link
Member

pmp-p commented Apr 26, 2024

probably it is better to ask your educators to integrate python+games in cursus, instead of trying to breach local security. You could also try to pack your game to a single (big) html file eg https://pmp-p.github.io/python3.html

standalone games packing issue : #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants