Go language - is there any Google Chrome wrapper like in Python

59 views
Skip to first unread message

SProgrammer

unread,
Jan 31, 2014, 3:04:52 AM1/31/14
to discuss...@googlegroups.com

Is there any WebRTC compiled stable version available for warping with Go language (cross platform), to make similar Skype like executable and release for cross platform.


To give you short idea, here is one example, which launch in cross platform and open google chrome. But instead of Google Chrome i want to open it like Python webKit. I know some hacks & tricks but i want to have Go instance running so that i can have full duplex packet switching.


Go:

package main
import "os/exec"
import "runtime"
import "fmt"
import "net/http"
const url = "http://localhsot:9090?embedded=webrtc"

func main
() {  

  myos
:= runtime.GOOS // linux, freebsd, netbsd, openbsd, plan9, darwin, windows
  fmt
.Println (runtime.GOARCH) // 386, amd64, arm    
 
if myos == "windows" {
   
if myarch == "386" {
      chrome
:= "C:/Program Files/Google/Chrome/Application/chrome.exe"
   
} else {
      chrome
:= "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
   
}          

    cmd
:= exec.Command(chrome, "--chrome-frame", "--kiosk", url)
    err
:= cmd.Start()
   
if err != nil {
      println
("Failed to start chrome:", err)
   
}

 
} else if myos == "darwin" {

   
if myarch == "386" {
      cmd
:= exec.Command("open", "-b" , "com.google.Chrome", "--args", "--chrome-frame", "--kiosk", url)
   
} else {
      cmd
:= exec.Command("open", "-b" , "com.google.Chrome", "--args", "--chrome-frame", "--kiosk", url)
   
}

    err
:= cmd.Start()
   
if err != nil {
      fmt
.Println("failed")
   
}

 
} else {

   
if myarch == "386" {
      chrome
:= "google-chrome"
   
} else {
      chrome
:= "google-chrome"
   
}  

    cmd
:= exec.Command(chrome, "--chrome-frame", "--kiosk", url)
    err
:= cmd.Start()
   
if err != nil {
      fmt
.Println("failed")
   
}
   
 
}

}



Python:

import gtk 
import webkit 
view = webkit.WebView() 
sw = gtk.ScrolledWindow() 
sw.add(view) 
win = gtk.Window(gtk.WINDOW_TOPLEVEL) 
win.add(sw) 
win.show_all() 
view.open("http://apprtc") 
gtk.main()
Reply all
Reply to author
Forward
0 new messages