Skip to content

IE9 이하 버전에서 크로스 사이트 서버 사용 시 JSONP-Polling 동작이 안되는 문제 #23

Description

@nangchang

클라이언트가 IE9 이하 버전이고,

socket.io 서버의 도메인이 다른 경우,

JSONP-Polling trnasport가 정상 동작하지 않는 문제가 있습니다.

클라이언트로 전송되는 data가 항상 "io.j[0]" 로 되어 있어서 발생하는 문제로 보입니다.


데이터를 보낼때 클라이언트의 i 파라메터값을 읽어와서 io.j[]의 인덱스로

전송하도록 문제가 해결 됩니다.

public JsonpPolling(Manager manager, ClientData clientData)  {
    super(manager, clientData);
    this.head = "io.j";
    this.foot = ");";
}

protected void doWrite(String encodedPacket) {
           ...
    String index = clientData.getParams().get("i");
    String result = Json.encode(encodedPacket);
    String data = (encodedPacket == null) ? "" : this.head + "[" + index +
                               "](" + result + this.foot;
            ...
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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