The host in ApolloServer context is not real

The host entered by the user cannot be obtained in the context of ApolloServer

It is possible in WebApp.connectHandlers.use. How can I get the same value in the context of ApolloServer?

This is my code, Get the host in the Context of ApolloServer and get the result: localhost:4000

const server = new ApolloServer({
  context: async ctx => {
    console.log('Apollo server context: ',;
    //Apollo server context:  localhost:4000

  app: WebApp.connectHandlers,
  path: '/graphql',

WebApp.connectHandlers.use('/graphql', (req, res) => {
  if (req.method === 'GET') {

The host result obtained in WebApp.connectHandlers.use is the entered hostname, such as

WebApp.connectHandlers.use((req, res, next) => {
  if (req.headers && {
    console.log('WebApp connectHandlers: ',;
    //WebApp connectHandlers:
  return next();

What do I have to do to get in the context of ApolloServer? Please help me, thank you

The origin and referer cannot be retrieved from the context of ApolloServer. Is there any way

I asked this question in issuess of apollographql/apollo-server #4887