WICG / serial

Serial ports API for the platform.
https://wicg.github.io/serial/
Other
255 stars 46 forks source link

Web Serial API cannot access client ports issue #163

Closed vigor45 closed 2 years ago

vigor45 commented 2 years ago

Im trying to use Web Serial API to communicating with serial ports in a local machine. it works fine even hosted in local IIS. But it doesn't work when run from a server. JavaScript is client side language so why this difference? is there anyway to correct this by giving some privileges by changing below script ? or is there some more chrome experimental features to achieve this ? Thanks.

larsgk commented 2 years ago

Im trying to use Web Serial API to communicating with serial ports in a local machine. it works fine even hosted in local IIS. But it doesn't work when run from a server. JavaScript is client side language so why this difference? is there anyway to correct this by giving some privileges by changing below script ? or is there some more chrome experimental features to achieve this ? Thanks.

When you run from the server, have you made sure the app is hosted using HTTPS and there is a valid certificate?

larsgk commented 2 years ago

@vigor45 - try to look here (related to secure contexts): https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features/

reillyeon commented 2 years ago

Please re-open this issue if you can provide more details about your environment and the error you are encountering. At this moment this issue report is unactionable.

vigor45 commented 2 years ago

Im trying to use Web Serial API to communicating with serial ports in a local machine. it works fine even hosted in local IIS. But it doesn't work when run from a server. JavaScript is client side language so why this difference? is there anyway to correct this by giving some privileges by changing below script ? or is there some more chrome experimental features to achieve this ? Thanks.

When you run from the server, have you made sure the app is hosted using HTTPS and there is a valid certificate?

It works. Thanks!