Skip to content

Help please! can't connect to my java websocket server #13

@wmSDevs

Description

@wmSDevs

Hi, I have a java websocket server with multiple websocket endpoints, each one with a specific location in LAN. example:

http://[my local ip]:[port]/myJavaApp/webSocket1
http://[my local ip]:[port]/myJavaApp/webSocket2
http://[my local ip]:[port]/myJavaApp/webSocket3 etc..

The example sketch is working fine with "echo.websocket.org", but I just cant connect to my websocket server endpoints.

That's what I'm trying...

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char server[] = "[my local ip]:[port]/myJavaApp/webSocket1";
WebSocketClient client;

void setup() {
Serial.begin(9600);
Ethernet.begin(mac);
client.connect(server);
client.setDataArrivedDelegate(dataArrived);
client.send("Hello World!");
}

void loop() {
client.monitor();
}

void dataArrived(WebSocketClient client, String data) {
Serial.println("Data Arrived: " + data);
}

Also I have tried with client.connect(server,port); but I don't know how to indicate the /myJavaApp/webSocket1 location.

I know my java server is ok because I can use Javascript clients and all is working fine.
I hope you can help me, I think is just about setup.

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