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

CORS Support? #29

Closed
MichealReed opened this issue Jul 10, 2019 · 1 comment
Closed

CORS Support? #29

MichealReed opened this issue Jul 10, 2019 · 1 comment

Comments

@MichealReed
Copy link

I'm working to implement this and utilize it with flutter_web. Is there something specific that needs to be done to support?

I tried to add it to the packet in socket.dart lines 157 - 163

    var packet = {
        'type': binary ? BINARY_EVENT : EVENT,
        'data': sendData,
        'options': {
          'Access-Control-Allow-Origin: *',
          'compress': this.flags?.isNotEmpty == true && this.flags['compress']
        }
      };
@MichealReed
Copy link
Author

Found the solution.

    // Dart client
      IO.Socket socket = IO.io('ws://localhost:8090', <String, dynamic>{
    'transports': ['websocket'],
    'extraHeaders': {'Access-Control-Allow-Origin': '*'}

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

1 participant