Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

connect ECONNREFUSED 0.0.0.0:4321 #7203

Closed Unanswered
bearcattt asked this question in Q&A
Discussion options

So, I am using astro & vite for a website, I ran pnpm dev and it seems like it's still showing the error.

The current config I have is

import { execSync } from 'child_process';
import node from '@astrojs/node';
import tailwind from '@astrojs/tailwind';
import { baremuxPath } from '@mercuryworkshop/bare-mux/node';
import { epoxyPath } from '@mercuryworkshop/epoxy-transport';
import { scramjetPath } from '@mercuryworkshop/scramjet';
import { server as wisp } from '@mercuryworkshop/wisp-js/server';
import playformCompress from '@playform/compress';
import { defineConfig } from 'astro/config';
import { normalizePath } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import { version } from './package.json';
export default defineConfig({
 output: 'static',
 adapter: node({ mode: 'middleware' }),
 server: {
 port: 4321,
 },
 base: '/absproxy/4321',
 integrations: [
 tailwind(),
 playformCompress({
 CSS: false,
 HTML: true,
 Image: true,
 JavaScript: true,
 SVG: true,
 }),
 ],
 prefetch: {
 prefetchAll: false,
 defaultStrategy: 'viewport',
 },
 vite: {
 define: {
 VERSION: JSON.stringify(version),
 LAST_UPDATED: JSON.stringify(check()),
 },
 plugins: [
 {
 name: 'viteserver',
 configureServer(server) {
 server.httpServer?.on('upgrade', (req, socket, head) => {
 if (req.url?.startsWith('/wsp/')) {
 wisp.routeRequest(req, socket, head);
 }
 });
 },
 },
 viteStaticCopy({
 targets: [
 {
 src: normalizePath(epoxyPath + '/**/*.mjs'),
 dest: 'assets/packaged/ep',
 overwrite: false,
 },
 {
 src: normalizePath(baremuxPath + '/**/*.js'),
 dest: 'assets/packaged/bm',
 overwrite: false,
 },
 {
 src: `${scramjetPath}/**/*.js`.replace(/\\/g, '/'),
 dest: 'assets/packaged/scram',
 overwrite: false,
 rename: (name) => `${name.replace('scramjet.', '')}.js`,
 },
 ],
 }),
 ],
 },
});
You must be logged in to vote

Replies: 1 comment

Comment options

Is this a question for code-server or for the Vite folks? 0.0.0.0:4321 would imply you are hitting the port directly, without involving code-server.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /