Code Monkey home page Code Monkey logo

Comments (3)

billabt avatar billabt commented on June 18, 2024

Can you post a bit more info? Specifically what erro you're receiving on client side and maybe a log of what's happening on the server when the error occurred. Thanks.

from bluesocket.

Nahatakyan avatar Nahatakyan commented on June 18, 2024

Web trying to connect with socket.io. In the first time, when client connects, he send this data:

Server received from connection at ::1:51265: GET /socket.io/?EIO=4&transport=polling&t=O1X3EZt HTTP/1.1
Host: localhost:1338
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Origin: http://127.0.0.1:5500
DNT: 1
Connection: keep-alive
Referer: http://127.0.0.1:5500/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site

But the next I have this situation and receiving data did not stop. I want to know if maybe I need to send a response?
Screen Shot 2022-04-25 at 18 11 38

In javascript written this code:

<script src="https://cdn.socket.io/3.1.3/socket.io.min.js" integrity="sha384-cPwlPLvBTa3sKAgddT6krw0cJat7egBga3DJepJyrLl4Q9/5WLra3rrnMcyTyOnh" crossorigin="anonymous"></script>

<script>
    const socket = io("localhost:1337", {
        reconnectionDelay: 5000,
        reconnection:false,
        transports: ["websocket"],
        reconnectionAttempts: 10,
        agent: false,
        upgrade: false,
        rejectUnauthorized: false
    });
    socket.on("connect", (data) => {
        console.log("sdfsdfsdfs");
    });
    socket.on("connect_error", (err) => {
        console.log(err);
    });
</script>

Now we don't know how to connect to the server from the web without WebSocket or Socket.io. Maybe you can help us to show the way, how can we do it. Thanks.

from bluesocket.

Nahatakyan avatar Nahatakyan commented on June 18, 2024

I found the solution in WebSocket documentation. Thanks.

from bluesocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.