logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

bing-chat-gateway-go

A Go-based proxy solution offering a streamlined user interface to interact with Microsoft Bing AI, including image creation capabilities. It supports self-hosting for deployment customization and enables access without requiring a Microsoft account login.

Author

bing-chat-gateway-go logo

Karry-cpu

MIT License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

bingaibingapisbingai accessbing aimicrosoft bing

go-proxy-bing

This project presents a demonstration interface for Microsoft's New Bing, custom-built using Vue3 and Go. It ensures a uniform user experience, supports established ChatGPT prompting conventions, functions reliably within mainland China, and encompasses nearly all features of the native Bing AI, granting chat access without mandatory sign-in.

⭐ If the primary Microsoft chat endpoint (generally faster and more reliable) becomes inaccessible, consider these alternatives:

  1. Utilize a tool like ModHeader to inject the X-Forwarded-For request header targeting wss://sydney.bing.com/sydney/ChatHub. Refer to issue #71 and https://zhuanlan.zhihu.com/p/606655303 for specifics.

  2. Deploy this service locally to act as a chat relay, or download a pre-compiled release. Configure the custom chat server setting to http://localhost:8080 and select it.

⭐ The default chat server selection is currently Cloudflare Workers (limited to 100,000 requests daily, unsustainable long-term). Self-hosting is recommended; see the Deploy Chat Server section for instructions.

⭐ Operational within China (Deployment requires direct connectivity to www.bing.com, bypassing CN redirects; SOCKS proxy configuration is available).

⭐ Compatibility with existing open-source ChatGPT prompt libraries.

⭐ For advanced features like image generation (requires selecting the 'More Creative' mode or configuring via Settings => Image Creation in the top right), logging into a Microsoft account and setting user Cookies is necessary.

⭐ For troubleshooting, first attempt the action in the bottom-left corner. If that fails, use a hard refresh (Shift + F5 or Ctrl + Shift + R, or the reset option in settings). The final recourse is clearing browser cache and Cookies (useful for resolving 24-hour limits, login prompts, etc.).

Web Interface Views

  • Desktop view, logged out state

  • Desktop view, logged in state

  • Desktop view for image creation

⭐ Requires authentication and selecting the 'More Creative' dialogue style

  • Mobile view, logged out state
  • In the Edge browser, chat and composition functionalities can be added to the sidebar separately.

Live Demos

Oracle Cloud Instance (Light Load Testing)

  • https://bing.vcanbb.top

Railway Deployment Examples

  • https://bing-railway.vcanbb.top

  • https://go-proxy-bingai-production.up.railway.app

Vercel Deployment Examples

  • https://bing-vercel.vcanbb.top

  • https://go-proxy-bingai-adams549659584.vercel.app

Render Deployment Examples

  • https://bing-render.vcanbb.top

  • https://go-proxy-bingai.onrender.com

User Configuration

  • Navigate to https://www.bing.com/ or https://cn.bing.com/ and sign in.

  • Open Developer Tools (F12 or Ctrl + Shift + I).

  • Obtain the value of the _U cookie. Input this value into the 'Set User' section within the website's settings.

Environment Variables

bash

Listening port, default 8080 (Optional)

PORT=8080

SOCKS proxy configuration example (Optional)

Go_Proxy_BingAI_SOCKS_URL=192.168.0.88:1070

SOCKS username (Optional)

Go_Proxy_BingAI_SOCKS_USER=xxx

SOCKS password (Optional)

Go_Proxy_BingAI_SOCKS_PWD=xxx

Default user Cookie setup (Optional, not recommended for static assignment). Use the prefix Go_Proxy_BingAI_USER_TOKEN_X to set multiple. Unauthenticated users will be assigned randomly; shared accounts will quickly hit rate limits and the 24-hour cap.

Go_Proxy_BingAI_USER_TOKEN_1=xxx Go_Proxy_BingAI_USER_TOKEN_2=xxx Go_Proxy_BingAI_USER_TOKEN_3=xxx ...

Simple authorization password (Optional)

Go_Proxy_BingAI_AUTH_KEY=xxx

Deployment Options

⭐ Requires an HTTPS domain (configure via nginx or similar). (Both frontend and backend have restrictions; browser compression encoding (br) is only included if served over HTTPS, except for localhost).

Supports Linux (amd64 / arm64), Windows (amd64 / arm64).

SOCKS environment variables can be configured for deployments within mainland China.

Docker

Refer to Dockerfile and docker-compose.yml

  • Docker command example

bash

Run container, map port 8080

docker run -d -p 8080:8080 --name go-proxy-bingai --restart=unless-stopped adams549659584/go-proxy-bingai

Configure SOCKS proxy environment variables

docker run -e Go_Proxy_BingAI_SOCKS_URL=192.168.0.88:1070 -e Go_Proxy_BingAI_SOCKS_USER=xxx -e Go_Proxy_BingAI_SOCKS_PWD=xxx -d -p 8080:8080 --name go-proxy-bingai --restart=unless-stopped adams549659584/go-proxy-bingai

  • Docker Compose example

yaml version: '3'

services: go-proxy-bingai: # Image identifier image: adams549659584/go-proxy-bingai # Container name assignment container_name: go-proxy-bingai
# Automatic restart policy restart: unless-stopped ports: - 8080:8080 # environment: # - Go_Proxy_BingAI_SOCKS_URL=192.168.0.88:1070 # - Go_Proxy_BingAI_SOCKS_USER=xxx # - Go_Proxy_BingAI_SOCKS_PWD=xxx # - Go_Proxy_BingAI_USER_TOKEN_1=xxx # - Go_Proxy_BingAI_USER_TOKEN_2=xxx

Pre-compiled Release

Download the appropriate compressed package for your platform from GitHub Releases. After extraction, the executable file go-proxy-bingai can be run directly.

Railway

Primarily requires configuring the Dockerfile path and the listening port.

bash PORT=8080 RAILWAY_DOCKERFILE_PATH=docker/Dockerfile

One-click deployment button => Deploy on Railway

Manual configuration settings for Railway deployment:

Vercel

⭐ Vercel deployment does not support Websocket connections; use the official chat server or Cloudflare Workers.

One-click deployment button => Deploy with Vercel

Render

One-click deployment button => Deploy to Render

Deploy Chat Server

Core code located in worker.js

Consult external tutorials for deploying Cloudflare Workers. The general steps are:

  • Sign up for a Cloudflare account

  • Create a Worker service, copy the entirety of the code from worker.js, paste it into the new service, save, and deploy.

  • Customize the access domain within the 'Triggers' section.

Future Tasks (TODO)

  • [x] Compose feature implementation
  • [x] Vue3 framework migration
  • [x] Prompt handling
  • [x] Conversation history recall
  • [x] Message export functionality (Markdown, Image, PDF)
  • [x] Basic access authorization controls

WIKIPEDIA: XMLHttpRequest (XHR) is an API in the form of a JavaScript object whose methods transmit HTTP requests from a web browser to a web server. The methods allow a browser-based application to send requests to the server after page loading is complete, and receive information back. XMLHttpRequest is a component of Ajax programming. Prior to Ajax, hyperlinks and form submissions were the primary mechanisms for interacting with the server, often replacing the current page with another one.

== History == The concept behind XMLHttpRequest was conceived in 2000 by the developers of Microsoft Outlook. The concept was then implemented within the Internet Explorer 5 browser (1999). However, the original syntax did not use the XMLHttpRequest identifier. Instead, the developers used the identifiers ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). As of Internet Explorer 7 (2006), all browsers support the XMLHttpRequest identifier. The XMLHttpRequest identifier is now the de facto standard in all the major browsers, including Mozilla's Gecko layout engine (2002), Safari 1.2 (2004) and Opera 8.0 (2005).

=== Standards === The World Wide Web Consortium (W3C) published a Working Draft specification for the XMLHttpRequest object on April 5, 2006. On February 25, 2008, the W3C published the Working Draft Level 2 specification. Level 2 added methods to monitor event progress, allow cross-site requests, and handle byte streams. At the end of 2011, the Level 2 specification was absorbed into the original specification. At the end of 2012, the WHATWG took over development and maintains a living document using Web IDL.

== Usage == Generally, sending a request with XMLHttpRequest has several programming steps.

Create an XMLHttpRequest object by calling a constructor: Call the "open" method to specify the request type, identify the relevant resource, and select synchronous or asynchronous operation: For an asynchronous request, set a listener that will be notified when the request's state changes: Initiate the request by calling the "send" method: Respond to state changes in the event listener. If the server sends response data, by default it is captured in the "responseText" property. When the object stops processing the response, it changes to state 4, the "done" state. Aside from these general steps, XMLHttpRequest has many options to control how the request is sent and how the response is processed. Custom header fields can be added to the request to indicate how the server should fulfill it, and data can be uploaded to the server by providing it in the "send" call. The response can be parsed from the JSON format into a readily usable JavaScript object, or processed gradually as it arrives rather than waiting for the entire text. The request can be aborted prematurely or set to fail if not completed in a specified amount of time.

== Cross-domain requests ==

In the early development of the World Wide Web, it was found possible to brea

See Also

`