Giter VIP home page Giter VIP logo

Comments (6)

aofei avatar aofei commented on June 1, 2024

Sorry, I didn't understand what you meant. It looks like you're not using this project. This project is a minimalist Go module proxy handler, not a binary file you can use directly. Maybe you asked the wrong project?

from goproxy.

Dereking avatar Dereking commented on June 1, 2024

I built this project and got a executable binary file goproxy. I think you are Chinese, here the Chinese:

我从这个项目编译了一个可执行文件。在服务器上运行:goproxy -proxy=https://goproxy.io
本地内网开发环境设置了$GOPROXY=mygoproxyweb
然后本地创建了一个测试golang项目,import 了github.com/gin-gonic/gin

本地go build时,mygoproxyweb 却返回了302响应(内网无法访问goproxy.someimg.com):
Location https://goproxy.someimg.com/github.com/gin-gonic/gin/@v/v1.5.0.zip

经测试:
本地访问 https://mygoproxyweb/github.com/gin-gonic/gin/@v/v1.5.0.zip 会被redirect 到goproxy.someimg.com
互联网访问 https://goproxy.io/github.com/gin-gonic/gin/@v/v1.5.0.zip 也会被redirect 到goproxy.someimg.com

我在https://github.com/goproxy/goproxy 源代码里没有找到 someimg.com . 难道这个是https://goproxy.io 的功能,并没有在代码里面?

from goproxy.

Dereking avatar Dereking commented on June 1, 2024

$ curl -v https://goproxy.io/github.com/gin-gonic/gin/@v/v1.5.0.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 119.28.201.50:443...

  • TCP_NODELAY set
  • Connected to goproxy.io (119.28.201.50) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
    ...........................(ssl)
  • Using HTTP2, server supports multi-use
  • Connection state changed (HTTP/2 confirmed)
  • Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
    } [5 bytes data]
  • Using Stream ID: 1 (easy handle 0xe41300)
    } [5 bytes data]

GET /github.com/gin-gonic/gin/@v/v1.5.0.zip HTTP/2
Host: goproxy.io
user-agent: curl/7.68.0
accept: /

{ [5 bytes data]

  • Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
    } [5 bytes data]
    < HTTP/2 302
    < server: nginx/1.16.1
    < date: Thu, 12 Mar 2020 11:27:26 GMT
    < content-type: text/html; charset=utf-8
    < content-length: 89
    < location: https://goproxy.someimg.com/github.com/gin-gonic/gin/@v/v1.5.0.zip
    <
    { [89 bytes data]
    100 89 100 89 0 0 640 0 --:--:-- --:--:-- --:--:-- 644Found.

  • Connection #0 to host goproxy.io left intact

from goproxy.

aofei avatar aofei commented on June 1, 2024

你确定你在使用这个项目嘛?这个项目跟 goproxy.io 是无关的哦,如果你发现访问某些东西被 302 了那说明是他们的表现既如此,跟你具体怎么用是无关的。你也可以试试用 goproxy.cn 做上游,是不会出现任何 302 行为的。

from goproxy.

aofei avatar aofei commented on June 1, 2024

此外,当前这个项目的使用方式是写代码哦:

package main

import (
	"net/http"

	"github.com/goproxy/goproxy"
)

func main() {
	http.ListenAndServe("localhost:8080", goproxy.New())
}

而不是编译,这个项目是一个可引入的三方库。

from goproxy.

Dereking avatar Dereking commented on June 1, 2024

ok~ 我试一下

from goproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.