Skip to content

Commit

Permalink
feat(Android): 特殊处理下CML链接的WS端口号
Browse files Browse the repository at this point in the history
  • Loading branch information
bbssyyuui committed May 17, 2021
1 parent 466b0c9 commit 9863ac2
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ private String toWSUrl(String url) {
}

Uri uri = Uri.parse(url);
String authority = uri.getAuthority();
if (TextUtils.isEmpty(authority)) {
return null;
}

return "ws://" + authority;
// 如果是CML的链接,需要特殊处理一下端口号,因为CML的CLI会占用原始端口(如:http://x.x.x.x:8000/tenon/index.js)
if (uri.getPath().startsWith("/tenon")) {
return "ws://" + uri.getHost() + ":39340";
}
return "ws://" + uri.getAuthority();
}
}

0 comments on commit 9863ac2

Please sign in to comment.