Proxy Server 프로그램 소스 입니다.
본 자료는 2페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
해당 자료는 2페이지 까지만 미리보기를 제공합니다.
2페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

Proxy Server 프로그램 소스 입니다.에 대한 보고서 자료입니다.

본문내용

sizeof(serv_addr))<0 ) {
perror(\"connect to WEB server error!!!\"); return -1;
}
/* make newURL and send it to WEB server */
if( !nextflag )
sprintf( buf, \"%s %s %s \\n%s\\n\\n\", method, newURL, HTTPver, buf2 );
else
sprintf( buf, \"%s %s %s \\n%s\", method, newURL, HTTPver, buf2 );
if( write( servsd, buf, strlen(buf) ) < 0 ) {
perror(\"request newURL to WEB server Error!!!\"); return -1;
};
printf( \"=======> SND to WEB = [%s]\\n\", buf ); /**/
if( nextflag ) { /* more to read : NETSCAPE */
if( (rc = read(clisd, buf, sizeof(buf)-1)) <= 0 ) {
perror(\"read error from BROWSER !!!\"); close(servsd); return -1;
}
buf[rc] = 0;
printf( \"from BROWSER 2 == %d[%s]\\n\", rc, buf );
fflush(stdout); /**/
if( write( servsd, buf, rc ) < 0 ) {
perror(\"send POST data to WEB server Error!!!\"); return -1;
};
printf( \"=======> SND2 to WEB = [%s]\\n\", buf ); /**/
}
/*서버에게 요청을 보냈으니 이제는 서버의 응답을 읽어 브라우저로 보내야한다*/
printf(\"------ Send response to BROWSER .... --------\\n\");
toClient( servsd, clisd );
return 0;
}
int toClient( servsd, clisd )
int servsd;
int clisd;
{
int i;
int rc=1;
char buf[4096+1];
while( rc > 0 ) {
if( (rc = read(servsd, buf, sizeof(buf)-1)) <= 0 ) {
perror(\"connection closeed from WEB server!!!\\n\");
close(servsd);
close(clisd);
return -1;
}
buf[rc] = 0;
printf( \"from WEB == %d[%.60s]\\n\", rc, buf );
fflush(stdout); /**/
if( write( clisd, buf, rc ) < 0 ) {
perror(\"-----Send to BROWSER Error!!!---------\");
};
printf(\"-----After Send to BROWSER !!! [%.60s]---------\\n\", buf);
fflush(stdout); /**/
}
}

키워드

Proxy Serv,   프로그램,   소스,   stdio,   sys,   include
  • 가격1,300
  • 페이지수7페이지
  • 등록일2002.01.07
  • 저작시기2002.01
  • 파일형식한글(hwp)
  • 자료번호#190917
본 자료는 최근 2주간 다운받은 회원이 없습니다.
다운로드 장바구니