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 Issue #44

Open
yunxiangtc opened this issue Jun 10, 2020 · 3 comments
Open

websocket Issue #44

yunxiangtc opened this issue Jun 10, 2020 · 3 comments
Labels
question Further information is requested

Comments

@yunxiangtc
Copy link

Great writer kataras :

In the demo given by websocket, the ws open link starts with "http://xxx", and then connect in the way of Upgrade! ! Now the project needs to be compatible with the mobile app and needs the "ws://xxx" style. How can I change it? please help me

@kataras kataras transferred this issue from kataras/iris Jun 10, 2020
@kataras
Copy link
Owner

kataras commented Jun 10, 2020

Hello @yunxiangtc, could you please give me more information, I didn't get it, code always speaks by itself, show me what you want from iris/neffos to do.

@mikepony
Copy link

iris-demo use websocket like this:”http://local host:80/api” send connect,
but in my project need: ws://local host:80/api, and need reuseport,help me ,please!

@kataras
Copy link
Owner

kataras commented Jul 11, 2020

@mikepony , examples uses ws:// to connect

var scheme = document.location.protocol == "https:" ? "wss" : "ws";
Let me explain, you will always need to register a route on your http web server, the websocket protocol is a sub-protocol of http. You connect through ws:// (or wss:// in tls mode) but the request first fires as http, then server replies with an upgrade response and asks the client to continue the communication using websocket.

Please show me a code snippet of your problem so I can be more helpful.

Thanks,
Gerasimos Maropoulos

@kataras kataras added the question Further information is requested label Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants