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

Doesn't work on WASM #20

Open
apuatcfbd opened this issue Dec 27, 2023 · 4 comments
Open

Doesn't work on WASM #20

apuatcfbd opened this issue Dec 27, 2023 · 4 comments

Comments

@apuatcfbd
Copy link

apuatcfbd commented Dec 27, 2023

Even the WASM build failing, There's a PR which solves that.
By using that PR I'm able to build a WASM binay & successfully load into browser,

But the unfortunate thing is WASM doesn't supports direct TCP communication so net.Dial doesn't work.

tcp 192.168.0.121:9100: Connection refused

(works natively - when running the (documented) code from terminal)

Is there any plan/ way to do that?

The thing I'm trying is to ship a WASM that will handle swift printing from the client site (since the printer in is clients (local) network.

Is it even possible?

@justinmichaelvieira
Copy link

@apuatcfbd I think it is currently only possible via Emscripten; If I'm understanding correctly this is a WASM limitation and not an escpos library one.

Can you take a look at WebAssembly/design#1251 (relevant closed WASM design issue with guidance), and let us know?

@apuatcfbd
Copy link
Author

At the current scope of this package, it's okay. I wanted to work with WASM to have a specific advantage. This isn't an issue.
Do you have any plan to implement something that works from WASM? Like in Epson printers I've seen that they support web sockets, which is available in WASM too.
But they way that works they call is ePOSprint I'm not sure if that is using the escpos standard or not.

@justinmichaelvieira
Copy link

Epos and escpos are two completely separate languages. So that's out of scope here, you'd need to use a library that targets epos language.

@justinmichaelvieira
Copy link

This issue can be closed, as the root cause of the issue is a wasm limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants