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

WASM friendly dependencies #175

Closed
olanod opened this issue Dec 21, 2020 · 9 comments
Closed

WASM friendly dependencies #175

olanod opened this issue Dec 21, 2020 · 9 comments

Comments

@olanod
Copy link

olanod commented Dec 21, 2020

Not only to make maintenance easier but also to potentially enable WASM compilation what about using higher level HTTP and WebSocket abstractions like surf(I guess better for async-std environments?) or reqwest and for WS perhaps something like ws_stream_wasm at least for the client stuff?

@niklasad1
Copy link
Member

Ok cool,

I think it's worth investigating for the client as you suggested, surf looks nice and ws_stream_wasm would require some conditional compilation because it only works for WASM.

@olanod
Copy link
Author

olanod commented Dec 21, 2020

For non WASM seems like ws_stream_tungstenite is the native equivalent

@niklasad1
Copy link
Member

niklasad1 commented Dec 21, 2020

For non WASM seems like ws_stream_tungstenite is the native equivalent

After #171 we assume that a separate sender and receiver of the WebSocket stream exist which tungstenite-rs doesn't provide and it doesn't has support for async/await AFAIU).

Thus, it's a not an ideal library for us but the ws_stream_wasm/JS bindings implements Sink and Stream which is good.

@olanod
Copy link
Author

olanod commented Jan 6, 2021

The one I linked is from the same person behind ws_stream_wasm is not tungstenite-rs but something on top that implements the same interface.

@niklasad1
Copy link
Member

#204 is merged which replaced hyper with surf. Thus, it now builds for WASM but I haven't tested it yet.

You have to disable the default-features and enable --feature wasm-client similar to what the CI does

@niklasad1
Copy link
Member

niklasad1 commented Feb 13, 2021

Sorry, we had to revert #204 because surf brought in OpenSSL as a dependency which I didn't realize and it is not possible to disable it but when/if it becomes possible to enable/disable TLS on it (ideally with rustls), then we could move back to use surf again.

I left the branch open if you want to use still.

@olanod
Copy link
Author

olanod commented Feb 13, 2021

I think http-rs/surf#271 would be the PR to track for that

@athei
Copy link
Member

athei commented Dec 7, 2021

I think http-rs/surf#271 would be the PR to track for that

I think that PR is merged and should be released by now?

@niklasad1
Copy link
Member

Right, yeah thanks for letting us know but we still need tokio 1.0 support for this to work :(

Closing this issue in favor of #227

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

3 participants