Skip to content
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

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

Open
nangchang opened this issue Apr 4, 2014 · 0 comments

Comments

@nangchang
Copy link

클라이언트가 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;
            ...
}
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

1 participant