Skip to content

i get headers instead of my sending data #14

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

Open
Ebrahimjz opened this issue Jun 12, 2019 · 1 comment
Open

i get headers instead of my sending data #14

Ebrahimjz opened this issue Jun 12, 2019 · 1 comment

Comments

@Ebrahimjz
Copy link

hi I am trying to send data with this library and when i see results in other side it sends just headers i cant find data
`
private static final int PORT_NUMBER = 3030;
private static final String HOST_ADDRESS = "192.168.1.102";
public static final String WEB_SOCKET_URL = "ws://" + HOST_ADDRESS + ":" + PORT_NUMBER + "/";

@OverRide
protected Void doInBackground(Void... voids) {
URI uri = null;
try {
uri = new URI(wsConfig.WEB_SOCKET_URL);
} catch (URISyntaxException e) {
e.printStackTrace();

    }

    webSocketClient = new WebSocketClient(uri) {
        @Override
        public void onOpen() {
            Log.i(TAG, "onOpen: "+"opened!!!");
                webSocketClient.send(Data);
        }

        @Override
        public void onTextReceived(String message) {
            System.out.println("onTextReceived");
        }

        @Override
        public void onBinaryReceived(byte[] data) {
            System.out.println("onBinaryReceived");
        }

        @Override
        public void onPingReceived(byte[] data) {
            System.out.println("onPingReceived");
        }

        @Override
        public void onPongReceived(byte[] data) {
            System.out.println("onPongReceived");
        }

        @Override
        public void onException(Exception e) {
            System.out.println("errrrroorrr"+e.getMessage());
        }

        @Override
        public void onCloseReceived() {
            System.out.println("onCloseReceived");
        }
    };

    webSocketClient.setConnectTimeout(10000);
    webSocketClient.setReadTimeout(60000);
    webSocketClient.enableAutomaticReconnection(5000);
    webSocketClient.connect();

`

result i get is like this on ws:
GET /HTTP /1.1
Host: my sender ip
upgrade:websocket
connection :Upgrade
Sec-webSocket:.....

and for wss i get some thing that cannot read or not like any language i thing it is encrypted

i hope you can help me i spend hole 2 week on this

@gusavila92
Copy link
Owner

does this always happen? How big is the data that you're trying to send? what server library are you using? did you try using a different server?

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

No branches or pull requests

2 participants