Giter Site home page Giter Site logo

Comments (7)

hugmouse avatar hugmouse commented on May 21, 2024 1

Nope. Right now i use another server and can't reproduce this bug anymore. So i guess i need to close this issue due i can't reproduce bug anymore (for this time)

If i somehow get this bug once more - i let you know.

from atreugo.

savsgio avatar savsgio commented on May 21, 2024

The message 2019/07/27 07:05:04 - atreugo - INFO - Updating address config with the new listener address is showed when you run atreugo with your own listener myserver.Serve(myNetListener) https://github.com/savsgio/atreugo/blob/master/atreugo.go#L96
not with myserver.ListenAndServe(), so it just update the configuration with your listener address. It's independent to use TLS or not.

And the listener_unix.go check if you have a multicore system and try to use reuseport to increase performance, if you want to run multiples atreugo instances.

So, could you share more code, please? How did you run in a single core?

from atreugo.

hugmouse avatar hugmouse commented on May 21, 2024

I run on single core just by using VPS with 1-core CPU. For some reason this code works fine on 2-VCPU server (serves HTTPS), but serves only HTTP on 1-VCPU server (ignoring TLSEnable option and whole config i guess).

VCPU - Virtual Central Processor Unit

The source code can be just the same as your example server, but with config that i provided in first message.

Sample code:

func main() {
	config := &atreugo.Config{
	Host:     "localhost",
	Port:      8445,
	TLSEnable: true,
	LogLevel:  logger.DEBUG,
	CertFile:  "./cert.pem",
	CertKey:   "./privkey.pem",
        }
	server := atreugo.New(config)

	server.Path("GET", "/", func(ctx *atreugo.RequestCtx) error {
		return ctx.HTTPResponse("<h1>Atreugo</h1>")
	})

	err := server.ListenAndServe()
	if err != nil {
		panic(err)
	}
}

Hope it helps somehow.

from atreugo.

savsgio avatar savsgio commented on May 21, 2024

Did you get some error?? Or just ignore TLS configuration and run server?

I will try to reproduce this case anyway.

from atreugo.

hugmouse avatar hugmouse commented on May 21, 2024

Did you get some error?? Or just ignore TLS configuration and run server?

I will try to reproduce this case anyway.

No errors at all, it just ignores config with TLS and serving default HTTP

from atreugo.

hugmouse avatar hugmouse commented on May 21, 2024

Tested it on different server with 1-core and can't reproduce this bug anymore... I guess this is some kind of heisenbug? :D

Here's my test build that wont work properly on my old 1VCPU build: https://cdn.mysh.dev/bug/reference.zip

And github mirror here: reference.zip

from atreugo.

savsgio avatar savsgio commented on May 21, 2024

I think so you have done the request with https://... prefix in the browser, right?

I have an VPS in with 1 core (1 VCPU), and your example server runs TLS without problems.

It's very strange, Could you fix it?

from atreugo.

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.