Skip to content

Add configurable CORS allowed origins #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

facchinm
Copy link
Member

@ArduinoBot
Copy link

✅ Build completed.

Download at http://downloads.arduino.cc/CreateBridge/CreateBridge-PR35.zip

@mastrolinux
Copy link
Contributor

@matteosuppo please test this one.

@matteosuppo
Copy link
Contributor

It's not working for me:

[msuppo@summer linux_amd64]$ ./Arduino_Create_Bridge 
INFO[0000] Version:1.0.0-dev-d762844                    
INFO[0000] Hostname: summer                             
INFO[0000] Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect. 
INFO[0000] You specified a serial port regular expression filter: usb|acm|com

INFO[0000] Your serial ports:                           
INFO[0000]  There are no serial ports to list.          
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET   /                         --> main.homeHandler (2 handlers)
[GIN-debug] POST  /upload                   --> main.uploadHandler (2 handlers)
[GIN-debug] GET   /socket.io/               --> main.*WsServer.ServeHTTP·fm (2 handlers)
[GIN-debug] POST  /socket.io/               --> main.*WsServer.ServeHTTP·fm (2 handlers)
[GIN-debug] WS    /socket.io/               --> main.*WsServer.ServeHTTP·fm (2 handlers)
[GIN-debug] WSS   /socket.io/               --> main.*WsServer.ServeHTTP·fm (2 handlers)
[GIN-debug] GET   /info                     --> main.infoHandler (2 handlers)
INFO[0000] Inside run of serialhub                      
[GIN-debug] Listening and serving HTTPS on :8991
[GIN-debug] Listening and serving HTTP on :8991
[GIN-debug] [ERROR] listen tcp :8991: bind: address already in use
INFO[0000] Error trying to bind to port: listen tcp :8991: bind: address already in use, so exiting... 
[GIN-debug] Listening and serving HTTPS on :8992

(Arduino_Create_Bridge:8435): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
http: TLS handshake error from [::1]:55206: tls: first record does not look like a TLS handshake

On localhost:8991 I get:

WebSocket connection to 'ws://localhost:8991/socket.io/?EIO=3&transport=websocket&sid=7x4MkfeheI6UWoKgj-0X' failed: Error during WebSocket handshake: Unexpected response code: 200

On http://webide.arduino.cc:8080/ide/#/home I get:

XMLHttpRequest cannot load http://localhost:8991/info. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://webide.arduino.cc:8080' is therefore not allowed access.
(index):1 XMLHttpRequest cannot load http://localhost:8992/info. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://webide.arduino.cc:8080' is therefore not allowed access.

This is the content of the config.ini:

configUpdateInterval = 0  # Update interval for re-reading config file set via -config flag. Zero disables config file re-reading.
gc = std  # Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)
hostname = unknown-hostname  # Override the hostname we get from the OS
ls = false  # launch self 5 seconds later
regex = usb|acm|com  # Regular expression to filter serial port list
v = true  # show debug logging
appName = CreateBridge
updateUrl = http://downloads.arduino.cc/
#updateUrl = http://localhost/
origins = http://webide.arduino.cc:8080

How can I help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants