Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: hijack blocked sometimes #23280

Closed
zmzmdr opened this issue Dec 29, 2017 · 5 comments
Closed

net/http: hijack blocked sometimes #23280

zmzmdr opened this issue Dec 29, 2017 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@zmzmdr
Copy link

zmzmdr commented Dec 29, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.2 windows/amd64

Does this issue reproduce with the latest release?

Yes, but only on my computer.
Which can not be produce in my anothrer computer.

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\SY-FuchunWang\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

What did you do?

Just run the following code.

package main

import (
	"log"
	"net/http"
)

func main() {
	http.HandleFunc("/", handler)
	log.Fatal(http.ListenAndServe(":8080", nil))
}

func handler(w http.ResponseWriter, r *http.Request) {
	h := w.(http.Hijacker)
	log.Println("calling hijack")
	c, _, err := h.Hijack()
	log.Println("hijack returned err=", err)
	c.Write([]byte("HTTP/1.1 200 OK\r\n\r\nOK"))
	c.Close()
}

What did you expect to see?

Not deadlock.

What did you see instead?

Here is my log console.
Hijack blocked ofen.

2017/12/29 14:28:52 calling hijack
2017/12/29 14:28:58 calling hijack
2017/12/29 14:29:02 calling hijack
2017/12/29 14:29:09 calling hijack
2017/12/29 14:29:09 hijack returned err= <nil>
2017/12/29 14:29:09 calling hijack
2017/12/29 14:29:09 hijack returned err= <nil>
2017/12/29 14:29:11 calling hijack
2017/12/29 14:29:12 calling hijack
2017/12/29 14:29:12 calling hijack

My system time is 2017/12/29 .

@mvdan mvdan changed the title Hijack blocked #Sometimes#. net/http: hijack blocked sometimes Dec 29, 2017
@mvdan mvdan added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 29, 2017
@bradfitz
Copy link
Contributor

Which Windows anti-virus software are you running?

@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 30, 2017
@zmzmdr
Copy link
Author

zmzmdr commented Jan 4, 2018

Sorry about the late reply. The reason i found was i'm running the AStrill VPN.

@mvdan
Copy link
Member

mvdan commented Jan 4, 2018

@zmzmdr so this only happens when you're using that VPN? Does the issue completely go away when you don't use it? Have you seen any other network or TCP/HTTP issues while using the VPN?

@zmzmdr
Copy link
Author

zmzmdr commented Jan 4, 2018

@mvdan The issue go away compeletely when i uninstall the AStrill VPN. The AStrill VPN has caused many network issues such as can not open Visual Studio, maven can not connect central repo. So i give up it.

@mvdan
Copy link
Member

mvdan commented Jan 4, 2018

Seems like it's not a Go issue then - thanks for following up.

@mvdan mvdan closed this as completed Jan 4, 2018
@golang golang locked and limited conversation to collaborators Jan 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants