Sky's blog

我和我追逐的梦

常用链接

统计

其他链接

友情链接

最新评论

解决subclipse通过http proxy访问subversion服务器的问题

        在eclipse中使用subclipse,发现无法访问到目标subversion服务器,总是报服务器无法连接。我连的subversion服务器采用apache以http的形式发布,用浏览器直接打开URL可以访问。由于公司网络环境是要求使用http proxy的,因此第一个想法就是eclipse没有使用http proxy因此无法连接外网。

        简单验证了一下,用eclipse的software update工具,试图访问外部站点获取更新信息,报错无法访问。问题确认,找了一下eclipse的配置,window -》prererences-》General -》Network Connections 下,有网络连接的设置,默认是"Direct connection to the Internet"/直接访问因特网。

        这样当然出不去了,随即修改为公司目前使用的http proxy,测试了一下software update可以正常工作。中间有个小插曲,http proxy设置中,proxy.***.com前千万不要加"http://",否则无法使用,因为这个原因浪费了不少时间。但是再试subclipse连接subversion服务器时,还是同样的报错,无法连接到服务器。晕......

        google了一下没有找到直接答案,花了点时间最后找到了subversion的FAQ,发现有下面这么一段:

        http://subversion.tigris.org/faq.html#proxy
        What if I'm behind a proxy?

The Subversion client can go through a proxy, if you configure it to do so. First, edit your "servers" configuration file to indicate which proxy to use. The files location depends on your operating system. On Linux or Unix it is located in the directory "~/.subversion". On Windows it is in "%APPDATA%\Subversion". (Try "echo %APPDATA%", note this is a hidden directory.)

There are comments in the file explaining what to do. If you don't have that file, get the latest Subversion client and run any command; this will cause the configuration directory and template files to be created.

        言下之意,subversion客户端访问外网时,http proxy的设置是通过“%APPDATA%\Subversion\servers”这里来设置的,eclipse的设置对它无效!

        不说二话,直接找到“%APPDATA%\Subversion\servers”文件,因为我这里情况简单,直接修改最下面的[global]设置,打开注释并修改为当前环境下的http-proxy

http-proxy-host = iproxy-sh.****.se
http-proxy-port = 8080

        再试就ok了,成功连接到subversion服务器。

        PS: 中间还看到,subversion使用到一些特殊的http head,比如PROPFIND, REPORT, MERGE, MKACTIVITY, CHECKOUT。对于某些无法支持这些header的http proxy,需要使用其他的方法,比如使用https。由于暂时没有遇到这个问题,不花时间研究了。

update: 发现在linux上,通过subversion来访问网络,也是可以设置代理服务器的,方法类似,不过需要修改的文件时当前用户的home目录下, .subversion/servers文件,方式同上。

posted on 2008-08-26 11:07 sky ao 阅读(2472) 评论(1)  编辑  收藏 所属分类: Version Control

评论

# re: 解决subclipse通过http proxy访问subversion服务器的问题[未登录] 2008-08-26 12:02 tester

不错,我的网络也是这样  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: