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

Websocket use with .net 7 #591

Open
simone-gasparini opened this issue Aug 12, 2024 · 1 comment
Open

Websocket use with .net 7 #591

simone-gasparini opened this issue Aug 12, 2024 · 1 comment

Comments

@simone-gasparini
Copy link

We have tested the library, with some modifications, and it seems to work.
Is there any limitation or problem? Why is limited to NETFX? ConnectionFactory.cs#L157

@xinchen10
Copy link
Member

xinchen10 commented Aug 26, 2024

The WebSockets APIs were not available in the netstandard targes. It was provided as extended NuGet packages. We have a separate package, AMQPNetLite.WebSockets, which can be referenced in your project. After that you can have the following code to use it with addresses starting with "ws" or "wss".

            var connectionFactory = new ConnectionFactory(new TransportProvider[] { new WebSocketTransportFactory() });
            Connection connection = await connectionFactory.CreateAsync(wsAddress);

With the newer .net version it may be different but that would require the library to add a new target framework where websockets can be enabled.

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