Main Contents

Servlet thorough a proxy server

Finally I found how to make a servlet go through the UTS proxy server for it to access YouTube.


My web application (to be available online soon...) calls a Java servlet that does HTTP requests to YouTube server. See YouTube Developer Area for more information. There are nice example web apps.


I had a proxy problem ... well not really a problem, but it was a problem for me due to my lack of knowledge. While the process takes about 2 minutes without the proper setting, it only takes 200 msec with the appropriate setting. The URL should be set as below:

URL url = new URL("http", proxyHost, proxyPort, youtubeGetVideoByTagString);

... This is to make a Java servlet use a specific proxy server.

Comments

Post a comment

(research:log では不適切なコメントを防止するため、コメントを掲載する前に管理者がコメントの内容を確認しています。コメントを初めて投稿する場合すぐに掲載されませんが、管理者が適切なコメントと判断した場合コメントは直ちに表示されますので、再度コメントを投稿する必要はありません。)

コメントフォーム

Copyright © here.