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

Comments

Projects
None yet
4 participants
@zmzmdr
Copy link

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

@bradfitz

This comment has been minimized.

Copy link
Member

commented Dec 30, 2017

Which Windows anti-virus software are you running?

@zmzmdr

This comment has been minimized.

Copy link
Author

commented Jan 4, 2018

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

@mvdan

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Member

commented Jan 4, 2018

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

@mvdan mvdan closed this 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.
You can’t perform that action at this time.