Comments (7)
I'm now running it with chrome port forwarding and a USB cable, and it works perfectly fine.
I appreciate it guys, we are building something big with this
from webxr-samples.
You'll need to use something like adb reverse
or port forwarding in Chrome so that you're visiting something that looks like a local URL on device e.g. localhost
or 127.0.0.1
to circumvent the HTTPS restriction for local dev
from webxr-samples.
Ah, that's the problem - 192.168.1.20 isn't a localhost address. You need to use http://localhost:8887 or http://127.0.0.1:8887. (Or, for IPv6, "::1" and "localhost6" also work.) Even if 192.168.1.20 is your device's current IP address, as far as I know that's not recognized as localhost.
If this was your PC's address, that's definitely not a localhost address. It specifically means "same device", not "on the same local network".
I assume you mean a local HTTP server? HTTPS isn't needed for localhost, and setting up the certificates needed for HTTPS would be an unnecessary annoyance.
from webxr-samples.
There's a HTTPS requirement for using WebXR, but using localhost has an exception for that and should work. What's the exact URL you're using for the localhost test?
file:// URLs are not considered to be localhost addresses, you need to use HTTP to access http://localhost:8000 or similar using either port forwarding or a local http server.
from webxr-samples.
Thank you, I just tested with HTTPS local server and it worked, but before trying HTTPS, I was running "Web Server for chrome" App on my PC, and on my AR compatible phone I was using http://192.168.1.20:8887/proposals/phone-ar-hit-test.html to access. I also enabled "#allow-insecure-localhost" just in case, but did not help.
from webxr-samples.
I don't remember where I got it but I use the following as "server.py" and this works really well.
# -*- coding: utf-8 -*-
#test on python 3.4 ,python of lower version has different module organization.
import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map={
'.manifest': 'text/cache-manifest',
'.html': 'text/html',
'.png': 'image/png',
'.jpg': 'image/jpg',
'.svg': 'image/svg+xml',
'.css': 'text/css',
'.js': 'application/x-javascript',
'': 'application/octet-stream', # Default
}
httpd = socketserver.TCPServer(("", PORT), Handler)
print("serving at port", PORT)
httpd.serve_forever()
then it should be served to http://127.0.0.1:8080 It's so easy and small that I just keep a copy in every project so I cas serve directly from the file (just double click) and not worry about anything it.
from webxr-samples.
serve on npm and python's SimpleHTTPServer are two basic servers for this purpose, in addition to @wimachtendink's snippet above. I'll file an issue indicating that some text would be helpful explaining the secure context requirements used by WebXR.
Thanks for filing!
from webxr-samples.
Related Issues (20)
- WebXR Content Broken in Chrome in Android 12 HOT 1
- Animated gltf HOT 1
- Modifying attributes
- WebXR Samples VR Not Found - Vive Pro 2, SteamVR Beta, Chrome 97 / Edge 97 HOT 11
- AR sample doesnt work on OnePlus 7T HOT 1
- Stats fps display overflow
- A blinking bug on pause video in WebXR Layers HOT 3
- Immersive ar session samples not work HOT 1
- Hittest-offsetRay -may be same mistake in origin.z HOT 2
- Depth sensing not work on pixel 4XL
- Video alpha not working with skybox HOT 1
- Anchors Drifting HOT 11
- How do I render cesium scene to webxr? HOT 1
- Hit Test with Anchors WebXR #19 sample crashes on my device HOT 2
- License for equirect test images?
- WebXR samples renderer issue
- Video Playback not working on VR mode using Safari and Vision Pro Simulator
- XRProjectionLayerInit in the webxr layers samples is not the same as in Spec
- Immersive AR does not work on the Samsung browser HOT 1
- Open AR screen with script without clicked button
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webxr-samples.