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

Connection through transports: ['websocket'] only #70

Closed
agarzas opened this issue Sep 24, 2018 · 3 comments
Closed

Connection through transports: ['websocket'] only #70

agarzas opened this issue Sep 24, 2018 · 3 comments

Comments

@agarzas
Copy link

agarzas commented Sep 24, 2018

Which platform(s) does your issue occur on?

  • Android
  • Device
  • CLI: 4.2.2
  • Cross-platform modules: 4.2.0
  • Plugin(s): 3.1.5

Is this plugin capable of establish connections through websockets only?
If I set the socket.io sever as: transports: ['websocket'] I get a lot of logs saying:

engine intercepting request for path "/socket.io/" +34s
engine handling "GET" http request "/socket.io/?EIO=3&token=ABC&transport=polling" +0ms
engine unknown transport "polling" +0ms

Here is my code:
`socket:SocketIO

constructor(
    private _authenticationHandlerService: AuthenticationHandlerService,
    private _routerExtensions: RouterExtensions,
    private _ngZone: NgZone
) {
    let options: IOOptions = {
        query: {
            token: "ABC"
        },
        debug: true,
        forceWebsockets: true,
    }
    this.socket = new SocketIO("http://{local-ip}", options)
}`

this.socket.connect();

It only works when I set the server to accept 'polling' and then it can´t upgrade to websockets...

@triniwiz
Copy link
Owner

forceWebsockets: true is for ios I think android uses transports:['websocket'] I'll try adding a common prop for both platforms

@NazimMertBilgi
Copy link

It doesn't work in Angular. There is also no key called transports.

@triniwiz please help me

@NazimMertBilgi
Copy link

I solved my problem in this link. The problem was caused by my settings from Nginx.

socketio/socket.io#1942 (comment)

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

No branches or pull requests

3 participants