Firefox代理到Docker Fiddler拒绝连接

时间:2016-05-14 02:23:00

标签: firefox docker fiddler

在Ubuntu-14.04主机上运行docker-fiddler容器。容器带来小提琴并将GUI重定向到主机,但代理失败。 Docker ver 1.11.1,

Firefox会显示“连接已重置”或“代理服务器拒绝连接”,具体取决于下面显示的设置。

问题:

  1. 什么是正确的Firefox代理设置,http和ssl?
  2. docker run cmd line需要进行哪些更改?
  3. Dockerfile需要进行哪些更改?
  4. 注意:我正在点击http网址,而不是https

    此配置localhost,假设端口为fwd,FF输出:连接已重置

    Firefox proxy: 
    manual proxy 
    HTTP Proxy 127.0.0.1 Port 8888
    SSL Proxy 127.0.0.1 Port 8888
    

    此配置,使用容器ip,FF输出:代理服务器拒绝连接

    Firefox proxy: 
    manual proxy 
    HTTP Proxy 172.17.02 Port 8888
    SSL Proxy  172.17.02 Port 8888
    

    TL; DR

    Docker Run:

     docker run -d -p 8888:8888 -v /tmp/.X11-unix:/tmp/.X11-unix -e \
     DISPLAY=$DISPLAY fiddler -h $HOSTNAME -v \
     $HOME/.Xauthority:/home/$USER/.Xauthority
    

    docker ps:

    16a4f7531222  fiddler "mono /app/Fiddler.ex"   3 hours ago Up 3 hours 0.0.0.0:8888->8888/tcp   cranky_pare
    

    Dockerfile jwieringa/docker-fiddler,我添加了公开8888,用户配置支持bind mount X服务器

    FROM debian:wheezy
    RUN apt-get update \
      && apt-get install -y curl unzip \
      && rm -rf /var/lib/apt/lists/*
    RUN apt-key adv --keyserver pgp.mit.edu --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/3.12.0 main" > /etc/apt/sources.list.d/mono-xamarin.list \
      && apt-get update \
      && apt-get install -y mono-devel ca-certificates-mono fsharp mono-vbnc nuget \
      && rm -rf /var/lib/apt/lists/*
    RUN cd /tmp && curl -O http://ericlawrence.com/dl/MonoFiddler-v4484.zip
    RUN unzip /tmp/MonoFiddler-v4484.zip
    ## I added this for X11 Display of Fiddler GUI on linux Host 
    RUN groupadd -g <gid> <user>
    RUN useradd -d /home/<user> -s /bin/bash -m <user> -u <uid> -g <gid>
    USER <user>
    ENV HOME /home/<user>
    # I added this also
    EXPOSE 8888
    ENTRYPOINT ["mono", "/app/Fiddler.exe"]
    

1 个答案:

答案 0 :(得分:0)

1)主机被认为是docker-fiddler容器的远程计算机

Fiddler > Tools > Fiddler Options > Connections > [x] Allow remote computers to connect

2)Fiddler在更改此属性后需要重置,这会关闭容器。必须将bind-mount卷添加到Dockerfile以维护配置

-v /tmp/docker-fiddler/.mono:/home/$USER/.mono 

3)首先在主机上创建/tmp/docker-fiddler/.mono并给它$ USER权限。 Docker应该为我做这个,但是,我不确定如何

4)将docker run更改为:

  docker run -d -p 8888:8888 \
   -v /tmp/.X11-unix:/tmp/.X11-unix \
   -h $HOSTNAME \
   -v $HOME/.Xauthority:/home/$USER/.Xauthority \
   -v /tmp/docker-fiddler/.mono:/home/$USER/.mono \
   -e DISPLAY=$DISPLAY fiddler

5)对于调试,更改上面的第一行添加Debug(-D)并删除守护进程(-d),这样做是找到缺少的libs的关键

docker -D run -p 8888:8888   

6)有几个lib缺失,最后一个是gsettings-desktop-schema,它包含/引入了gnome代理模式。 fiddler使用它,直到这就是&#34; AllowRemote&#34;配置设置未存储

.mono/registry/CurrentUser/software/telerik/fiddler/values.xml:<value name="AllowRemote"

7)对Dockerfile的一些更改,包括使用ubuntu,创建了一个非常大的图像,或许可以退出libglib2.0-bin libcanberra-gtk-module:

FROM ubuntu:14.04

RUN apt-get update \
  && apt-get install -y curl unzip libglib2.0-bin libcanberra-gtk-module gsettings-desktop-schemas \
  && rm -f /etc/apt/sources.list.d/mono-xamarin* \
  && rm -rf /var/lib/apt/lists/*

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list \
  && apt-get update \
  && apt-get install -y mono-complete ca-certificates-mono fsharp mono-vbnc nuget \
  && rm -rf /var/lib/apt/lists/*

RUN cd /tmp && curl -O http://ericlawrence.com/dl/MonoFiddler-v4484.zip

RUN unzip /tmp/MonoFiddler-v4484.zip

RUN groupadd -g 1000 <USER>
RUN useradd -d /home/<USER> -s /bin/bash \
-m <USER> -u <UID> -g <GID>
USER <user>
ENV HOME /home/<USER>

EXPOSE 8888

ENTRYPOINT ["mono", "/app/Fiddler.exe"]

8)Firefox代理, - 没有解决HTTPS / SSL

FF > edit > preferences > Advanced > settings

manual proxy 
HTTP Proxy <container-ip> Port 8888
SSL Proxy  <left this blank>

请参阅:Install Mono on Linux

参见:Docker In Practice,Miell / Sayers - CH4 Tech 26运行GUI,X11