我试图让SSL流星工作HTTPS和WebSockets的。 我得到这个错误:
(STDERR) Error: listen EACCES 0.0.0.0:443
这里是我的设置。
对于SSL访问我已经安装了nourharidy /流星SSL。 我可以使用任何类似的包或方法,人们已经发现有用!
所要求的nourharidy /流星SSL,在server/main.js
我有:
SSL('/path/to/private/server.key','/path/to/private/server.crt', 443);
这是我设置的休息:
我ROOT_URL环境变量是:
https://10.0.1.10:443 //I’m using my Mac’s ip address so that another Mac can access it
在imports/startup/server/index.js
我有:
//SET UP APOLLO QUERY / MUTATIONS / PUBSUB
const USING_HTTPS = true;
const httpProtocol = USING_HTTPS ? "https" : "http";
const localHostString = '10.0.1.10' //I’m using my Mac’s ip address so that another Mac can access it
const METEOR_PORT = 443;
const GRAPHQL_SUBSCRIPTION_PORT = 4000;
const subscriptionsEndpoint = `wss://${localHostString}:${GRAPHQL_SUBSCRIPTION_PORT}/subscriptions`;
const server = express();
server.use('*', cors({ origin: `${httpProtocol}://${localHostString}:${GRAPHQL_SUBSCRIPTION_PORT}` }));
server.use('/graphql', bodyParser.json(), graphqlExpress({
schema
}));
server.use('/graphiql', graphiqlExpress({
endpointURL: '/graphql',
subscriptionsEndpoint: subscriptionsEndpoint
}));
// We wrap the express server so that we can attach the WebSocket for subscriptions
const ws = createServer(server);
ws.listen(GRAPHQL_SUBSCRIPTION_PORT, () => {
console.log(`GraphQL Server is now running on ${httpProtocol}://${localHostString}:${GRAPHQL_SUBSCRIPTION_PORT}`);
// Set up the WebSocket for handling GraphQL subscriptions
new SubscriptionServer({
execute,
subscribe,
schema
}, {
server: ws,
path: '/subscriptions',
});
});
我在想什么?
非常感谢提前对所有的任何信息!