# How to use / support https server for ApolloServer PluginDrainHttpServer plugin?

**URL:** <https://community.apollographql.com/t/how-to-use-support-https-server-for-apolloserver-plugindrainhttpserver-plugin/5860>\
**Category:** Server\
**Tags:** server, web\
**Created:** [March 2, 2023, 10:20pm UTC](https://community.apollographql.com/t/how-to-use-support-https-server-for-apolloserver-plugindrainhttpserver-plugin/5860 "2023-03-02T22:20:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cliffordfajardo](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/cliffordfajardo/32/3983_2.png) [@cliffordfajardo](https://community.apollographql.com/u/cliffordfajardo)\
**Post date:** [March 2, 2023, 10:20pm UTC](https://community.apollographql.com/t/how-to-use-support-https-server-for-apolloserver-plugindrainhttpserver-plugin/5860/1 "2023-03-02T22:20:05Z")

</div>

I am currently using an https node js server at work.

I was wondering if the apollo plugin `ApolloServerPluginDrainHttpServer` meant for http servers only or can you pass it an https server?

The docs show an example of using http server like this:

```auto
import http from 'http';
...
const httpServer = http.createServer(app);

// Same ApolloServer initialization as before, plus the drain plugin
// for our httpServer.

const server = new ApolloServer({
  typeDefs,
  resolvers,
  plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
});

```

**Would that plugin work for https server from the https module?**  
The docs only seem to cover http server: [API Reference: Drain HTTP Server Plugin - Apollo GraphQL Docs](https://www.apollographql.com/docs/apollo-server/api/plugin/drain-http-server/)

 ![CleanShot 2023-03-02 at 14.17.44@2x](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/e/eeca8ecc84114cfeb257dcdf35d878edae8ddd82.jpeg)

---

<div class="post-metadata">

**Author:** ![trevor.scheer](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/trevor.scheer/32/5669_2.png) [@trevor.scheer](https://community.apollographql.com/u/trevor.scheer)\
**Post date:** [March 3, 2023, 4:56pm UTC](https://community.apollographql.com/t/how-to-use-support-https-server-for-apolloserver-plugindrainhttpserver-plugin/5860/2 "2023-03-03T16:56:55Z")

</div>

This should just work, more details in the related issue where I responded:

> <https://github.com/apollographql/apollo-server/issues/7414>
>
> Currently it seems like the \`drainHttpServer\` plugin only works for HTTP servers…:
> 
> Docs: https://www.apollographql.com/docs/apollo-server/api/plugin/drain-http-server/
> \<img width="1272" alt="image" src="https://user-images.githubusercontent.com/6743796/222572875-5454b053-55bb-4d5e-882d-8ce154ea7668.png"\>
> 
> Will there be support for passing an \`https\` server? 
> At work I am using an https nodejs server

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:49pm UTC](https://community.apollographql.com/t/how-to-use-support-https-server-for-apolloserver-plugindrainhttpserver-plugin/5860/3 "2025-02-06T20:49:24Z")

</div>


