Comments (5)
Hi,
- We do not support offline loading of the frontend as it is now.
- For websockets, we have also experience that local lan ip's can be tricky. Google Chrome requires the websocket to be hosted with SSL (so wss://) if its not localhost. I'm aware of 2 ways around this
- Make a ssh tunnel to the remote IP address forwarding the websocket port
- Host the websocket with a self-signede certificate (bit tricky to setup)
I recommend using the first solution. This is what we did in the coral sorter project: https://coral.ai/projects/teachable-sorter/#42-connect-your-raspberry-pis-camera-output-to-teachable-machine
from teachablemachine-community.
HalfdanJ,
I have a secure websocket camera with a self signed certificate through a local certificate store plus includes subject alternate names and it works on chrome.
But I can't get it to work through TM demo and I believe the problem is in TM demo.
javascript console:
index.bundle.js:3179 Mixed Content: The page at 'https://teachablemachine.withgoogle.com/train/image?network=true' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://rpi-buster1:443/'. This request has been blocked; this endpoint must be available over WSS.
__connect @ index.bundle.js:3179
handleEvent @ index.bundle.js:2
__boundHandleEvent @ index.bundle.js:2
click @ index.bundle.js:3294
handleEvent @ index.bundle.js:2
__boundHandleEvent @ index.bundle.js:2
index.bundle.js:3179 Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
at HTMLElement.__connect (https://teachablemachine.withgoogle.com/index.bundle.js:3179:2059)
at y.handleEvent (https://teachablemachine.withgoogle.com/index.bundle.js:2:823386)
at HTMLElement.__boundHandleEvent (https://teachablemachine.withgoogle.com/index.bundle.js:2:822749)
at HTMLElement.click (https://teachablemachine.withgoogle.com/index.bundle.js:3294:36490)
at y.handleEvent (https://teachablemachine.withgoogle.com/index.bundle.js:2:823386)
at HTMLButtonElement.__boundHandleEvent (https://teachablemachine.withgoogle.com/index.bundle.js:2:822749)
__connect @ index.bundle.js:3179
handleEvent @ index.bundle.js:2
__boundHandleEvent @ index.bundle.js:2
click @ index.bundle.js:3294
handleEvent @ index.bundle.js:2
__boundHandleEvent @ index.bundle.js:2
Initially i had a secure server running on a different port e.g. 8000 then i changed to 443 but still no luck.
it seems "ws://" is hardcoded in the js code:
this.__socket = new WebSocket("ws://" + this.address + ":" + this.port),
suggestion: would be nice to allow secure sockets on any port, maybe, the decision of ws vs wss should based on the hostname specified e.g. ws for localhost, 127/8 or ::1 and wss for all the other values.
from teachablemachine-community.
Aaah I see. Ill take a look into this.
from teachablemachine-community.
Good catch,
I'm going to do this instead
let address = this.address;
if (!address.match(/.+:\/\/.+/im)) {
address = 'ws://' + address;
}
this.__socket = new WebSocket(address + ':' + this.port);
This should allow that if you specify a protocol it will use it, or default to ws:// if not.
from teachablemachine-community.
The websocket fix has been pushed now.
from teachablemachine-community.
Related Issues (20)
- [BUG]: Unsupported URL scheme in metadata? HOT 1
- Question: train on a Colab Notebook with the same training algorithm as the teachable machine HOT 2
- How can I run this on my own? HOT 4
- Prediction is not same as in Teachable web HOT 29
- Boundrybox and prediction on video[FEATURE REQUEST]: Title HOT 5
- URL export HOT 5
- Coding = wrong HOT 2
- Prediction are different in tensorflow.js from the web one HOT 8
- Repository Collaborator HOT 2
- [BUG]: docker failed to start HOT 4
- first prediction is slow HOT 2
- [BUG]: npm install and import is not work in React HOT 1
- [BUG]: @tensorflow/tfjs Dependency error due to version mismatch HOT 3
- [BUG]: The Chinese translation of 'app_timed-button_label_recording' is wrong
- [BUG]: Cannot write tm_template_script.ino to Arduino nano 33 BLE sense as recommended in the GettingStarted.
- Techable Machine Web and Keras models have different recognition rates. HOT 3
- [BUG]: tmImage doesn't work and throws an error around fetch() HOT 1
- Trying to use the audio TensorFlow model on node and can't figure out how
- [BUG]: snippets/markdown/audio/tensorflowjs/p5js.mdAudio and video training without python code
- Is audio model using tflite_runtime-2.5.0 possible?
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 teachablemachine-community.