diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a948f55 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +target/ +bench/ +.vscode/ +.private/ +.github/ diff --git a/Dockerfile b/Dockerfile index f16840f..5f6aad1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,8 @@ RUN apt-get update && apt-get install -qy --no-install-recommends $BUILD_DEPS && rm -fr ~/.cargo ~/.rustup && \ rm -fr /tmp/* /var/tmp/* /var/cache/apt/* /var/lib/apt/lists/* /var/log/apt/* /var/log/*.log &&\ rm -fr ~/.cargo ~/.rustup && \ - rm -fr /tmp/* /var/tmp/* /var/cache/apt/* /var/lib/apt/lists/* /var/log/apt/* /var/log/*.log + rm -fr /tmp/* /var/tmp/* /var/cache/apt/* /var/lib/apt/lists/* /var/log/apt/* /var/log/*.log &&\ + mkdir -p /var/log/rpxy && touch /var/log/rpxy/rpxy.log COPY docker-bin/run.sh / COPY docker-bin/entrypoint.sh / @@ -40,7 +41,7 @@ COPY docker-bin/entrypoint.sh / RUN chmod 755 /run.sh && \ chmod 755 /entrypoint.sh -EXPOSE 53/udp 53/tcp +EXPOSE 80 443 CMD ["/entrypoint.sh"] diff --git a/config-example.toml b/config-example.toml index f9cb30b..9196822 100644 --- a/config-example.toml +++ b/config-example.toml @@ -45,7 +45,7 @@ reverse_proxy = [ ] }, ] # Optional: TLS setting. if https_port is specified and tls is true above, this must be given. -tls = { https_redirection = true, tls_cert_path = 'localhost.pem', tls_cert_key_path = 'localhost.pem' } +tls = { https_redirection = true, tls_cert_path = './localhost.pem', tls_cert_key_path = './localhost.pem' } ## List of destinations to send data to. diff --git a/docker-compose.yml b/docker-compose.yml index 2a3ae2c..713af40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,8 +5,12 @@ services: container_name: rpxy restart: unless-stopped ports: - - 127.0.0.1:8080:8080 + - 127.0.0.1:8080:80 + - 127.0.0.1:8443:443 + build: + context: ./ tty: false privileged: true volumes: + - ./localhost.pem:/localhost.pem:ro - ./config-example.toml:/etc/rpxy.toml:ro diff --git a/src/config/parse.rs b/src/config/parse.rs index bb18674..9bc6bad 100644 --- a/src/config/parse.rs +++ b/src/config/parse.rs @@ -43,6 +43,8 @@ pub fn parse_opts(globals: &mut Globals, backends: &mut Backends) -> Result<()> if let Some(v) = config.listen_only_ipv6 { if v { listen_addresses.extend(LISTEN_ADDRESSES_V6.iter()); + } else { + listen_addresses.extend(LISTEN_ADDRESSES_V4.iter()); } } else if let Some(v) = config.listen_ipv6 { listen_addresses.extend(LISTEN_ADDRESSES_V4.iter()); diff --git a/src/proxy/proxy_h3.rs b/src/proxy/proxy_h3.rs index a9eecc0..f71cf23 100644 --- a/src/proxy/proxy_h3.rs +++ b/src/proxy/proxy_h3.rs @@ -10,6 +10,7 @@ where T: Connect + Clone + Sync + Send + 'static, { pub async fn client_serve_h3(self, conn: quinn::Connecting) -> Result<()> { + // TODO: client数の管理 let client_addr = conn.remote_address(); match conn.await {