# How should one make a struct that handles a HTTP.jl server?

**URL:** <https://discourse.julialang.org/t/how-should-one-make-a-struct-that-handles-a-http-jl-server/129799>\
**Category:** General Usage\
**Tags:** question, struct, http\
**Created:** [June 11, 2025, 10:10am UTC](https://discourse.julialang.org/t/how-should-one-make-a-struct-that-handles-a-http-jl-server/129799 "2025-06-11T10:10:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AwesomeQuest](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/awesomequest/32/38910_2.png) [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Post date:** [June 11, 2025, 10:10am UTC](https://discourse.julialang.org/t/how-should-one-make-a-struct-that-handles-a-http-jl-server/129799/1 "2025-06-11T10:10:21Z")

</div>

`HTTP.server` says it can’t be `finalizer`d.  
`ERROR: objects of type HTTP.Servers.Server{HTTP.Servers.Listener{Nothing, Sockets.TCPServer}} cannot be finalized`

So if I have a `struct` like

```julia
mutable struct M
	reciverClient::HTTP.Server
	function M()
		reciverClient = HTTP.serve!(ip,port) do req
			return HTTP.Response()
		end
		new(reciverClient)
	end
end
client = M()

```

How can I make sure that I can make a new instance of `client`? Does the user have to manually call `close` on `client.reciverClient`?
