Skip to content

how to specify the request path please? #496

@videni

Description

@videni

I checked every where, failed to find the API.

Neither "http://localhost:8080" nor "http://localhost:8080/sync" works

client

    let socket = ClientBuilder::new("http://localhost:8080/sync")
        .namespace("/")
        .on("test", callback)
        .on("error", |err, _| eprintln!("Error: {:#?}", err))
        .connect()
        .expect("Connection failed");

Here is the trace log I got. Interesting, why does it try to connect port 1087?

2025-04-17T07:17:32.302478Z TRACE hyper_util::client::legacy::pool: checkout waiting for idle connection: ("http", 127.0.0.1:8080)
2025-04-17T07:17:32.302587Z TRACE hyper_util::client::legacy::connect::http: Http::connect; scheme=Some("http"), host=Some("127.0.0.1"), port=Some(Port(1087))
2025-04-17T07:17:32.302599Z DEBUG hyper_util::client::legacy::connect::http: connecting to 127.0.0.1:1087
2025-04-17T07:17:32.302794Z DEBUG hyper_util::client::legacy::connect::http: connected to 127.0.0.1:1087
2025-04-17T07:17:32.302829Z TRACE hyper_util::client::legacy::client: http1 handshake complete, spawning background dispatcher task
2025-04-17T07:17:32.302908Z TRACE hyper_util::client::legacy::pool: checkout dropped for ("http", 127.0.0.1:8080)
2025-04-17T07:17:32.581256Z TRACE hyper_util::client::legacy::pool: checkout waiting for idle connection: ("http", 127.0.0.1:8080)
2025-04-17T07:17:32.581299Z TRACE hyper_util::client::legacy::connect::http: Http::connect; scheme=Some("http"), host=Some("127.0.0.1"), port=Some(Port(1087))

server

 let (layer, io) = SocketIo::builder()
            .with_state(ChatRoomState::new(ctx.clone()))
            .req_path("/sync")
            .build_layer();

the server is running sucessfully

 curl -v http://localhost:8080/sync\?EIO\=4\&transport\=polling

0{"sid":"Z7fxChFRPI-3HTBX","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":20000,"maxPayload":100000}%    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions