{"_id":"@bun-community/sveltekit-adapter-bun","_rev":"8-bb90ffe103854816408441678f6e6d7e","name":"@bun-community/sveltekit-adapter-bun","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.2":{"name":"@bun-community/sveltekit-adapter-bun","description":"Adapter for SvelteKit apps that generates a standalone Bun.js server.","version":"0.0.2","main":"index.js","type":"module","dependencies":{"@rollup/plugin-commonjs":"^23.0.0","@rollup/plugin-json":"^5.0.0","@rollup/plugin-node-resolve":"^15.0.0","bun-types":"^0.1.11","tiny-glob":"^0.2.9"},"keywords":["svelte","sveltekit","sveltekit-adapter","bun"],"author":{"name":"bun-community","url":"https://github.com/bun-community/"},"contributors":[{"name":"Volodymyr Palamar"},{"name":"Dennis Dudek","email":"admin@kapsonfire.de"}],"gitHead":"0f3181c3661fb0b4e800516b22cc3a8d701dcded","_id":"@bun-community/sveltekit-adapter-bun@0.0.2","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-/QvoNrme+r8SA5k7A8SDAS5uCXvyBA3X2I68QQUZTF+H8uiX+fXFP6Tw1474Tz5uPWlrdDGOXIoXyaVcRmup9g==","shasum":"b083d8fc0eec3054949ec127d92917300ee0fdbc","tarball":"https://registry.npmjs.org/@bun-community/sveltekit-adapter-bun/-/sveltekit-adapter-bun-0.0.2.tgz","fileCount":6,"unpackedSize":35254,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGtdewR7F+lchPK/JmhVFL/vwes0DmcVPstVBmeBHbPMAiEA6uv9SEkTYui0FIePXSA4URV97KFUgvZ+vTaRIOpHDq4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjR79GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHWw/8CDbOY+RwZD52iJTuULNLi6Pqu0i/yd8xMnR2pCBwjlZrqA/C\r\n16LHdTPdYcFVpvSNBJksNCXXnKhT1MlwFpgQBcaavfNVVRpf8M9z1E/mrXxl\r\n9pwbXBb2U9HKfhcMLFx6ddXnuhsqoha5Rrq6MlGVhAwISYZP2W6Fk/lA8+3Q\r\nigjD+bhbb86WXiYna057ONzYEVfcBhdouIkAynI2jE8WOEX5nrqYapbRcEms\r\n/jRllZLlyLp59fF5fELY8MfCQuMe9kq8JAfFaXsG35LbAxBUfCGN3F+B3Gjz\r\n8v4GzScN3zhJko5EC1jnJBn+uIu9/4eB/oF1yVyDqnNi+oK8C0u/AnKbht2e\r\npWJry5zl9/yRGYfw6nibSAEDB9xmBeJ+/Z1yN47PiY1/3b8FeVUYpBzUehoE\r\ngMSbUqBXcMYsp9YTZkHKrX/7nUvdi90lSK5bhwBy5Q8jk+hGg/ui2qUIxtfp\r\nEYLbh25dCmlYQMctOA/j0f6HIsr9HBg+mbeGFBUUaTH7zeMBM40J7iLtVQfi\r\ntEqVBnrjni5Hxi29uSyRAcWBbaEqHp/zMayQzQjT7921yBldRg6mH+kLvFWp\r\nTOg4GN8TVuNvgDoe5M7DYwyCCRGfNFpWXXDKtiKaw6pInDi5kqIqIZsJso4T\r\neuiJ6Id216G1gu1U2uXNbg7zKKRakjh4pRU=\r\n=noeD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kapsonfire","email":"admin@kapsonfire.de"},"directories":{},"maintainers":[{"name":"kapsonfire","email":"admin@kapsonfire.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sveltekit-adapter-bun_0.0.2_1665646405476_0.2165011645182071"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.3":{"name":"@bun-community/sveltekit-adapter-bun","description":"Adapter for SvelteKit apps that generates a standalone Bun.js server.","version":"0.0.3","main":"index.js","type":"module","dependencies":{"@rollup/plugin-commonjs":"^23.0.0","@rollup/plugin-json":"^5.0.0","@rollup/plugin-node-resolve":"^15.0.0","bun-types":"^0.2.0","tiny-glob":"^0.2.9"},"keywords":["svelte","sveltekit","sveltekit-adapter","bun"],"author":{"name":"bun-community","url":"https://github.com/bun-community/"},"contributors":[{"name":"Volodymyr Palamar"},{"name":"Dennis Dudek","email":"admin@kapsonfire.de"}],"gitHead":"fc336d01fa9b6cf177ea1e572167a4f6e8200394","_id":"@bun-community/sveltekit-adapter-bun@0.0.3","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-/wO9BAVz4kmt5BGTj8EyRsVXLiQg+BrHFpg5wACuUjeKqytLVk07lf1FFFBy0H77lYSuI8oS/kR/ckHQu9hHOA==","shasum":"aad1f1969eec568228bff00cd14e9f70b86e8c98","tarball":"https://registry.npmjs.org/@bun-community/sveltekit-adapter-bun/-/sveltekit-adapter-bun-0.0.3.tgz","fileCount":6,"unpackedSize":35915,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiCoE40NoNF4/NM34TM7YpHMxAuy4M/bZi9kCtvHwvtAIgTY6JsL0cY+djlWFxdtCE7mumZVRViHrtk7X2LW72Xi8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSyNKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdRA/+JDaL1+I8cuFACqOoF8xrSlBCUS4KHaWBnzi47SqGUs8ahziv\r\nOoSmeygiEh1H6mPETGDei9kUP2rSLACLXDv3Hbs4X8ui+SzV8cSZvJcIVwWY\r\nKOsqB3TtRrLe8PCbfCO803Wz0uYRVvsNmvGA3HZlaSe/q0j4XqvwULETVPlm\r\nHByIbQnLeh7V3Q8V08ksxuUU3ttVFjlMqcfKiRO3oLcHa3aCpR4C/eGVVEv7\r\n35wSTiFL3RVeJ46KYBJZyivC8kWNVaI8M0P0RzqjKTGdx9ThMSm8274EdMsB\r\n6b7HL/SH5zbfEp4WJWLTUqhoXdMBG4QKH/YquEvw1Z6UPocD6FZnvDmW2RGh\r\nVyM/LFrbqAYl+8wdAb8oLH1TzUX16xMKqMEQiFyl1/fPGiA66JcWeSvA1cA1\r\n6A/H4WkRvsPAAfwzQ2958NmbsrVsHhCcTEdoGR7/vkMRTciTcBVmN4fOyZHf\r\nw34dVzRQ1FxIEdkkI0jgl27FyNY5oaBx+yHSJYMMmkaGP8U0mAwdqqxSHc0y\r\nmZtYk8W/lSKSIomIfgvshLNz3GvgUTObT9ZR6/LxViytLy/jDR/fbUk1pSKm\r\ngMVXMps0fjN83hUly5edBUTq5yl4xqEfC3knhS0IfMawq983Kaon+K0Efg4T\r\noVpJACMwEWLdYA8uV11mHaLSc3O3OrVrHRA=\r\n=oSyQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kapsonfire","email":"admin@kapsonfire.de"},"directories":{},"maintainers":[{"name":"jarred","email":"jarred@jarredsumner.com"},{"name":"kapsonfire","email":"admin@kapsonfire.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sveltekit-adapter-bun_0.0.3_1665868618157_0.6916796132514433"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.4":{"name":"@bun-community/sveltekit-adapter-bun","description":"Adapter for SvelteKit apps that generates a standalone Bun.js server.","version":"0.0.4","main":"index.js","type":"module","dependencies":{"@rollup/plugin-commonjs":"^23.0.0","@rollup/plugin-json":"^5.0.0","@rollup/plugin-node-resolve":"^15.0.0","bun-types":"^0.2.0","tiny-glob":"^0.2.9"},"keywords":["svelte","sveltekit","sveltekit-adapter","bun"],"author":{"name":"bun-community","url":"https://github.com/bun-community/"},"contributors":[{"name":"Volodymyr Palamar"},{"name":"Dennis Dudek","email":"admin@kapsonfire.de"}],"gitHead":"c1aea2242c3974d0db7c83bb56099e8455949e21","_id":"@bun-community/sveltekit-adapter-bun@0.0.4","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-7vU4Jk6U4XNzZmB9sIEcLyCrpxun02JipoGJrqE8qxx8MWopYUzdJ+eZSdJPpht4gpPqN7oNvtsZ8VxGd5V7jQ==","shasum":"f686b9e8bfb6d1a6c500a784ff2ee12b5dcc58db","tarball":"https://registry.npmjs.org/@bun-community/sveltekit-adapter-bun/-/sveltekit-adapter-bun-0.0.4.tgz","fileCount":6,"unpackedSize":35935,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICrDq25W2aMqZoJZPv/SSbYY9mMlaXW1+VhMmZYP+rTbAiEAyvv3uVSPAc6OWIKE+3C5+cQNbnFWcZteEftcrvAMrZ0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTUd5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSthAAmgq6fRlRzPlBR5uCwjk3eTsHv5nt/J3R8eVJwaqiiSbcfmtg\r\nmXa9x7sPsyyYgO8KIWOOEg818sx33jNpOh3O2h+oPh6kUWRMuU1e3sZXu6nb\r\n97B7K1Lrn13MryHyz29Sh3/bMSe4h4+d2d2sxAy8bEK3A2Wb1il031erdBf6\r\ny+8UozwRRm7XJoY54nzC0u3r6ChFzDsY8b52ztj5aIEzVovfqRYoHCaUQRnb\r\ntL7mD1lV05OXEbNzWopBB8QDH1OX7o4V7s2JYJ/kPLHsI6doOo20wBCIIHCT\r\nwhdolrXN6Qr0hCzcBNRRgMX5Nz0NO010Yz1i0UbbjxZ7ap2EUYrS1GrMq3Uw\r\ne0fmkBq4PPSLKZofQZ8/XPn7e/VgcfjvnqImrrty3/LOIT2opz5xQbfuPX13\r\nPdlYbdHEQx+X9CivrLJsr+Nu5sy6qg5GVSz+X4s2FFsd2IMsMdI3vW2Q/ncp\r\nW+ynChnxyMCCDuyy8+lmOoWY/hdwdypWq/FihNwVR0AA/IHjOalWKfFuI+6k\r\nTKAzC4keHClSJ0IGKX4y+DVwPCnjqxY2ajbjj3uPjV6RvvFJibsrzfgTCPZM\r\n3Yv9k3k7yD6IGWTcpuyvNsAfO0mpadQFyY8yqEYkKO1WP5zJKQmA92c/aGG8\r\npLP9RD45L29L5tcGNqK4+HmWL8Lpz16+TQg=\r\n=KuYK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kapsonfire","email":"admin@kapsonfire.de"},"directories":{},"maintainers":[{"name":"jarred","email":"jarred@jarredsumner.com"},{"name":"kapsonfire","email":"admin@kapsonfire.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sveltekit-adapter-bun_0.0.4_1666008953038_0.06548180904528844"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.5":{"name":"@bun-community/sveltekit-adapter-bun","description":"Adapter for SvelteKit apps that generates a standalone Bun.js server.","version":"0.0.5","main":"index.js","type":"module","dependencies":{"@rollup/plugin-commonjs":"^23.0.0","@rollup/plugin-json":"^5.0.0","@rollup/plugin-node-resolve":"^15.0.0","bun-types":"^0.2.0","tiny-glob":"^0.2.9"},"keywords":["svelte","sveltekit","sveltekit-adapter","bun"],"author":{"name":"bun-community","url":"https://github.com/bun-community/"},"contributors":[{"name":"Volodymyr Palamar"},{"name":"Dennis Dudek","email":"admin@kapsonfire.de"}],"gitHead":"c1aea2242c3974d0db7c83bb56099e8455949e21","_id":"@bun-community/sveltekit-adapter-bun@0.0.5","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-GPkT+4/tzXbqx0zI/+3ylvBnsBAksruAFHL5WVkzOpyRH4p60iyuFdYgwbpGNvX+zsDSP6DmOkd+ubvG/nAJrA==","shasum":"9529af9c191c2a43a5a619165a45c43ffec108ca","tarball":"https://registry.npmjs.org/@bun-community/sveltekit-adapter-bun/-/sveltekit-adapter-bun-0.0.5.tgz","fileCount":6,"unpackedSize":35997,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDkdkRJI9xJRMzkO3nitDmOe43sKCK0ObiyGzQ901vBwIhAP+KUe098sLcYWPCO2KF4Kv5Y3hGbnp+5aFAaagt1fSj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT+pIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocVA//UuxKlC8dLrvfH8uTk7kIlTk95wTM+xE5AM8AU1MEYbiQvhsh\r\nE/sRh6llzF5N2hY0mg6cQ9ckkrBNe+ri/TRCEFPnfrE+0walUayoDMU/afdb\r\nAy8o48vTu4dWqEn/RUDh+6D54sjgsL3f6Ltlcmf8SFQn+e8V2EiVS0d6ch6B\r\nEN6yIwA6l0i9MJdUUJciKugb1BFWWBl2e19vb4Q1Vm19jBfX77AEzZrhAM3X\r\nINqt93kS2nyZfkBGFnlGZXISr/IUx4FGc1gGiVePD0o1k+YC/Aus6u41v+6U\r\nFTKSKNyMboF0EJnoggLl6hW5gzj8Cb9V6twZLYrA1dmM2dwrTNXDis2PWX86\r\nF7c+GJQ6gdWUCQXt4PvvbCWbTZLv/BdXNnJgw14KUfMMqiKhTb1HpWcbiu3R\r\n8IaGde4V47dDWxc7pXt2k2YqE9XAmP1R/x/P1090UhWAx/LYPMQhMx+3+toQ\r\n1215CgPfsmk6sdO0QES8kBLmEExN7PbV47hMpJWDFTJc4pMKn+TWw9ViEvPb\r\n+nIzMIay+6VHSyM6pk6UyU+iCFMoX/DKIktwC/KoRrKQXM1XsxiZ85cVnC7o\r\nvi+wEOJ5sjk2gR9J27O3edjq45Yke9pe+j6ydHW81ELG2xNBI+SBzW9DKvTJ\r\nrR7LzjwCcwABuMzWgUJ9PWTLPjapEUODNsI=\r\n=ORAS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kapsonfire","email":"admin@kapsonfire.de"},"directories":{},"maintainers":[{"name":"jarred","email":"jarred@jarredsumner.com"},{"name":"kapsonfire","email":"admin@kapsonfire.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sveltekit-adapter-bun_0.0.5_1666181703980_0.3165595917722881"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.6":{"name":"@bun-community/sveltekit-adapter-bun","description":"Adapter for SvelteKit apps that generates a standalone Bun.js server.","version":"0.0.6","main":"index.js","type":"module","dependencies":{"@rollup/plugin-commonjs":"^23.0.0","@rollup/plugin-json":"^5.0.0","@rollup/plugin-node-resolve":"^15.0.0","bun-types":"^0.2.0","tiny-glob":"^0.2.9"},"keywords":["svelte","sveltekit","sveltekit-adapter","bun"],"author":{"name":"bun-community","url":"https://github.com/bun-community/"},"contributors":[{"name":"Volodymyr Palamar"},{"name":"Dennis Dudek","email":"admin@kapsonfire.de"}],"gitHead":"15a4a3ed3e151c61a3e164596c1b6b16ff041120","_id":"@bun-community/sveltekit-adapter-bun@0.0.6","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-s5/FyHS7xE76TOi3zFgBWgwlEJ1pHl6Q3S7XX92JDE2tFEryY77XkYAhWActGA+mg9YL3nWf5Qpje4uk8cKfIg==","shasum":"6c81106446e79f5a07c9b5b143dd65ec24c51aae","tarball":"https://registry.npmjs.org/@bun-community/sveltekit-adapter-bun/-/sveltekit-adapter-bun-0.0.6.tgz","fileCount":6,"unpackedSize":35999,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8Yp4QijNOX0QaloIxcyP+JXpinKF4wp0L5iRLF8R/AAiEA2CTWBOymqdT/b2aw/9LIpkgK5P4IRqCGCNtGYmwr91U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUvMsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqdBAAogfhWS9sQwwx2EnXLcYUx0UxSg3BT8fVCEBCcIlZy5dZuiwt\r\nVImZm1acZ59e+bj8sDhL6gd3GKyjB0oGRk/93y9YUOefqBE3j+w9lsIPurJH\r\nutqOH02RkczTq5ev8S6Eb08I7RJwq1VjU1d7Mus4YaxsI6KJCaM78w/fvfsz\r\nYMz71/sE6BUk9CxkVBceNO0nBUkBHgztMHpmJmXmQM24SL3UC/wd8sKwtN/W\r\nA23P1bIf5uLnUZL+MjM2sG6eewa/C3gRkqjbBwXtKJGIGYyjQflRBU+NqZGw\r\nX8X5Fki4LZH/nmaQKSDv5S6qlcIfHu+V2ZD6xR0r/tex1WNA2FkcLpzwVNSS\r\novhQOlCTv9vvGGyWE5sFgXr5rww6NXqHYBEW6JJD52POr2DfbLwczWjmVfDo\r\n9Xz+DK3zDYMstT17aG0My8+ath6w9r9sJSR7kiDmQlNKHa/il43e64g8bM8u\r\nQ+gPnWLE5Z/9JbTmE+JGnhbYol5ZXzc/sPFUwveU+51oVYeB7vQl25jdWBeP\r\nBF4EzSgyr/SQo6QMnqpSIOHUVKaHQ+Bp03FCVAILcGI+ySroUgHKNKX+6zgv\r\n1xyAm+LXj+XBRW39S4+7tGipXOvK79gkeWdjuY5+2IHgZa5yoKYx1Rf1Ru5x\r\nFDW4QEqGgvgTNaY/OxcM4pcpPZ8YJd+SAmg=\r\n=wzbJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kapsonfire","email":"admin@kapsonfire.de"},"directories":{},"maintainers":[{"name":"jarred","email":"jarred@jarredsumner.com"},{"name":"kapsonfire","email":"admin@kapsonfire.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sveltekit-adapter-bun_0.0.6_1666380587885_0.6840284677863291"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2022-10-13T07:27:55.750Z","0.0.1":"2022-10-13T07:27:55.998Z","modified":"2024-05-18T09:20:45.177Z","0.0.2":"2022-10-13T07:33:26.017Z","0.0.3":"2022-10-15T21:16:58.335Z","0.0.4":"2022-10-17T12:15:53.310Z","0.0.5":"2022-10-19T12:15:04.134Z","0.0.6":"2022-10-21T19:29:48.086Z"},"maintainers":[{"name":"jarred","email":"jarred@jarredsumner.com"},{"name":"kapsonfire","email":"admin@kapsonfire.de"}],"description":"Adapter for SvelteKit apps that generates a standalone Bun.js server.","keywords":["svelte","sveltekit","sveltekit-adapter","bun"],"contributors":[{"name":"Volodymyr Palamar"},{"name":"Dennis Dudek","email":"admin@kapsonfire.de"}],"author":{"name":"bun-community","url":"https://github.com/bun-community/"},"readme":"# @bun-community/sveltekit-adapter-bun\n\n[Adapter](https://kit.svelte.dev/docs/adapters) for SvelteKit apps that generates a standalone [Bun](https://github.com/oven-sh/bun) server.\n\n> **Warning**\n> **This is experimental module!** Bun does not support many things like [`FormData`](https://github.com/oven-sh/bun/issues/621)\n> So I can't promise it will work\n\n## Usage\n\nInstall with `bun add -d @bun-community/sveltekit-adapter-bun` or `npm i -D @bun-community/sveltekit-adapter-bun`, then add the adapter to your `svelte.config.js`:\n\n```js\n// svelte.config.js\nimport adapter from '@bun-community/sveltekit-adapter-bun';\n\nexport default {\n  kit: {\n    adapter: adapter()\n  }\n};\n```\n\nAfter building the server (`vite build`), use the following command to start:\n\n```\n# go to build directory\ncd build/\n\n# run Bun\nbun run start\n```\n\n\n### Exposed Websocket Server\nYou can use buns websocket server by exporting handleWebsocket object from src/hooks.server.ts\n```typescript\nexport const handleWebsocket = {\n    message: (ws, msg) => {\n        ws.send(msg);\n    },\n    //optionally, doesnt have to be set - can be used to deny websocket\n    upgrade: (req, upgrade) => {\n        upgrade(req, {data:1});\n    }\n}\n```\n\n\n## Options\n\nThe adapter can be configured with various options:\n\n```js\n// svelte.config.js\nimport adapter from '@bun-community/sveltekit-adapter-bun';\nexport default {\n  kit: {\n    adapter: adapter({\n      out: \"build\",\n      assets: true,\n      envPrefix: \"MY_CUSTOM_\",\n      development: true,\n      // precompress: true,\n      precompress: {\n        brotli: true,\n        gzip: true,\n        files: [\"htm\", \"html\"]\n      },\n      dynamic_origin: true,\n      xff_depth: 1\n    })\n  }\n};\n```\n\n### out\n\nThe directory to build the server to. It defaults to `build` — i.e. `bun run start` would start the server locally after it has been created.\n\n### assets\n\nBrowse a static assets. Default: `true`\n\n- [X] Support [HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests)\n\n### precompress\n\nEnables precompressing using gzip and brotli for assets and prerendered pages. It defaults to `false`.\n\n#### brotli\n\nEnable brotli precompressing. It defaults to `false`.\n\n#### gzip\n\nEnable gzip precompressing. It defaults to `false`.\n\n#### files\n\nfile extensions to compress.It defaults to `['html','js','json','css','svg','xml','wasm']`.\n\n### envPrefix\n\nIf you need to change the name of the environment variables used to configure the deployment (for example, to deconflict with environment variables you don't control), you can specify a prefix:\n\n```js\nenvPrefix: 'MY_CUSTOM_';\n```\n\n```\nMY_CUSTOM_HOST=127.0.0.1 \\\nMY_CUSTOM_PORT=4000 \\\nMY_CUSTOM_ORIGIN=https://my.site \\\nbun build/index.js\n```\n\n### development\n\nThis enables bun's error page. Default: `false`\n\n### dynamic_origin\n\nIf enabled use `PROTOCOL_HEADER` `HOST_HEADER` like origin. Default: `false`\n\n### xff_depth\n\nThe default value of XFF_DEPTH if environment is not set. Default: `1`\n\n## Environment variables\n\n> Bun automatically reads configuration from `.env.local`, `.env.development` and `.env`\n\n### `PORT` and `HOST`\n\nBy default, the server will accept connections on `0.0.0.0` using port 3000. These can be customized with the `PORT` and `HOST` environment variables:\n\n```\nHOST=127.0.0.1 PORT=4000 bun build/index.js\n```\n\n### `ORIGIN`, `PROTOCOL_HEADER` and `HOST_HEADER`\n\nHTTP doesn't give SvelteKit a reliable way to know the URL that is currently being requested. The simplest way to tell SvelteKit where the app is being served is to set the `ORIGIN` environment variable:\n\n```\nORIGIN=https://my.site bun build/index.js\n```\n\nWith this, a request for the `/stuff` pathname will correctly resolve to `https://my.site/stuff`. Alternatively, you can specify headers that tell SvelteKit about the request protocol and host, from which it can construct the origin URL:\n\n```\nPROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host bun build/index.js\n```\n\n> [`x-forwarded-proto`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto) and [`x-forwarded-host`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host) are de facto standard headers that forward the original protocol and host if you're using a reverse proxy (think load balancers and CDNs). You should only set these variables if your server is behind a trusted reverse proxy; otherwise, it'd be possible for clients to spoof these headers.\n### `ADDRESS_HEADER` and `XFF_DEPTH`\n\nThe [RequestEvent](https://kit.svelte.dev/docs/types#additional-types-requestevent) object passed to hooks and endpoints includes an `event.clientAddress` property representing the client's IP address. [Bun.js haven't got functionality](https://github.com/Jarred-Sumner/bun/issues/518) to get client's IP address, so SvelteKit will receive `127.0.0.1` or if your server is behind one or more proxies (such as a load balancer), you can get an IP address from headers, so we need to specify an `ADDRESS_HEADER` to read the address from:\n\n```\nADDRESS_HEADER=True-Client-IP bun build/index.js\n```\n\n> Headers can easily be spoofed. As with `PROTOCOL_HEADER` and `HOST_HEADER`, you should [know what you're doing](https://adam-p.ca/blog/2022/03/x-forwarded-for/) before setting these.\nIf the `ADDRESS_HEADER` is `X-Forwarded-For`, the header value will contain a comma-separated list of IP addresses. The `XFF_DEPTH` environment variable should specify how many trusted proxies sit in front of your server. E.g. if there are three trusted proxies, proxy 3 will forward the addresses of the original connection and the first two proxies:\n\n```\n<client address>, <proxy 1 address>, <proxy 2 address>\n```\n\nSome guides will tell you to read the left-most address, but this leaves you [vulnerable to spoofing](https://adam-p.ca/blog/2022/03/x-forwarded-for/):\n\n```\n<spoofed address>, <client address>, <proxy 1 address>, <proxy 2 address>\n```\n\nInstead, we read from the _right_, accounting for the number of trusted proxies. In this case, we would use `XFF_DEPTH=3`.\n\n> If you need to read the left-most address instead (and don't care about spoofing) — for example, to offer a geolocation service, where it's more important for the IP address to be _real_ than _trusted_, you can do so by inspecting the `x-forwarded-for` header within your app.\n","readmeFilename":"README.md"}