또는, 당신은 그것에 대해 안전하려면 :
HttpResponse res;
DefaultHttpClient httpclient = new DefaultHttpClient();
String authorizationString = "Basic " + Base64.encodeToString(("admin" + ":" + "").getBytes(), Base64.NO_WRAP); //this line is diffe
authorizationString.replace("\n", "");
try {
HttpGet request = new HttpGet(URI.create(url));
request.addHeader("Authentication",authorizationString);
res = httpclient.execute(request);
return new MjpegInputStream(res.getEntity().getContent());
} catch (ClientProtocolException e) {e.printStackTrace();}
} catch (IOException e) {e.printStackTrace();}
가 HTTP (기본) 인증 또는 쿠키 기반의 사용자 정의 시스템 (형태)인가? – SLaks
HTTP 기본 대신 HTTPS를 사용합니다. – user1757703
HTTPS는 내가 물어 본 질문과 직각을 이룹니다. 이 두 옵션은 HTTP 또는 HTTPS를 통해 사용할 수 있습니다. (비록 그들이 HTTP와 함께 사용하면 안된다) – SLaks